Error with existing COM Reference or adding a new one

北战南征 提交于 2019-12-05 17:53:24

One other thing to check for is if your COM library is registered in Windows' registery, which can you done like this:

%windir%\system32\regsvr32 YourComLibrary.dll

Next you'll need to create an interop .NET DLL that wraps around the COM library you are trying to reference in your C# project. The way to do this is by running the type library importer utility (use the Visual Studio 2010 command prompt):

tlbimp.exe YourComLibrary.dll /out:YourWrappedComLibrary.dll

As for the ADODB reference, you'll likely need to reference the Primary Interop Assembly for ADO (ADODB). This can be found on your machine at the following location. Add a reference to this and you should be good.

C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\adodb.dll

Hopefully the above gets you going. Its been too long since I've messed with COM... memory maybe foggy a bit. Enjoy!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!