HI,
In my C# windows application, I need to call one VC++ dll to read hardware. When I tried to add reference to dll got error " Reference "TestDll.dll" couldn't be added. Please make sure file is accessible, and that is valid assembly or COM component."
Any help appreciated.
Regards,
Vikram
Loading
Sam HobbsPosted May 25, 2013, 8:33 PM
Sam HobbsPosted Mar 31, 2012, 6:32 PM
As Vulpes indicates, the DLL is not likley a DLL that can be used by adding a reference to the project. The terminology to identify DLLs that can be used by adding a reference is confusing. Microsoft has made the terminology confusing. For this context, I think the best way to describe unmanaged DLLs that can be used by adding a reference is to say that the DLL is listed in the COM tab of the Add Reference dialog. Try using the Browse tab of the Add Reference dialog if you have not done that already. If that does not work then the DLL is probably a native DLL that you must either use Platform Invoke for or write a C++ wrapper for.
Do you have documentation of the DLL? You should. The documentation will make it totally clear whether the DLL is a native DLL.
VulpesPosted Mar 31, 2012, 2:44 PM
http://www.c-sharpcorner.com/uploadfile/tanmayit08/unmanaged-cpp-dll-call-from-managed-C-Sharp-application/
http://www.c-sharpcorner.com/UploadFile/SamTomato/managed-cpp-wrapper-for-unmanaged-code/