Tuesday, May 22, 2012

A reference to '.dll' could not be added. Please make sure that the file is accessible and that it is a valid assembly or COM component.


I was facing this issue while I want to utilize my VB6 Code as DLL in my WPF application in .NET framework 4.0 and Visual Studio 2010.
While adding VB6.0  DLL reference studio show me the error “A reference to '.dll' could not be added. Please make sure that the file is accessible and that it is a valid assembly or COM component.”
Solution 1:
I get solved this issue by using “tlbimp” utility. You can find this utility in Installed .NET Bin directory.
tlbimp myCOM.tlb /out:d:\interopAssembly.dll
Solution 2:
Another cause of facing this issue is 32 bit and 64 bit compatibility issue. There is no error while importing DLL in VS2010 installed on a 32 bit machine.

No comments:

Post a Comment