0

I got the same error with the following link but I couldn't solve my problem: A reference to the dll could not be added

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

As suggested, I located TblImp.exe in two directories: "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin" and "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64"

I used on both command prompt and VS2015 to use CMOS_USB.dll with TblImp.exe but couldn't solve my problem.

When I used command prompt I got;

C:\Users\tufankesen>TlbImp.exe CMOS_USB.dll 'TlbImp.exe' is not recognized as an internal or external command, operable program or batch file.

When I tried this in VS2015 Command window. I got;

"Command "TlbImp.exe" is not valid."

System Specs: 64-bit, VS2015 Extra: My source codes are in D:\Sources... folder

Thanks for any hints/replies

Community
  • 1
  • 1
tufankesen
  • 11
  • 1
  • 4
  • My guess is that the file you're trying to add is not a .Net assembly. Have you verified that it is? – JasonlPrice Feb 12 '16 at 11:50
  • The right spelling is Tlbimp.exe,not TlbImp.exe – Pikoh Feb 12 '16 at 11:51
  • It just isn't a valid assembly or COM component. You need to use pinvoke and that requires knowing the declarations of the exported functions. Contact the owner of the DLL for documentation and proper usage instructions. – Hans Passant Feb 12 '16 at 12:04

1 Answers1

0

TlbImp.exe is not in the Directory C:\Users\tufankesen

First change your directory:

cd "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin"

And then Execute TlbImp.exe

wertzui
  • 5,148
  • 3
  • 31
  • 51
  • I changed my directory then I got; TlbImp : error TI0000 : The input file 'C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64\CMOS_USB.dll' is not a valid type library. For upper folder error like this; TlbImp : error TI0000 : The input file 'C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\CMOS_USB.dll' is not a valid type library. – tufankesen Feb 12 '16 at 11:59