开发者

Assembly not listed in VS10 Object browser

I have a VB.Net project which needs to use a third party DLL for which there also an interop assembly. So I have something like this:

Hummingbird.DM.Server.Interop.PCDClient.dll
PCDClient.dll

I tried adding the reference to the interop directly in the project, but on running the file I got a COM not registered开发者_如何学C error.

So, I tried registering the interop as follows:

gacutil /if "C:\....\Hummingbird.DM.Server.Interop.PCDClient.dll"

regasm "C:\....\Hummingbird.DM.Server.Interop.PCDClient.dll"

Even after restarting VS, the assembly is still not visible.


Your regasm command destroyed the registry keys for the COM server. You'll have to reinstall it. Only use regasm on your own [ComVisible] code.

One reason you may have trouble using the component, beyond it just not having been installed correctly, is because you are trying to run this on a 64-bit operating system. And the component is 32-bit, by far the most common case. You need to force your app to run in 32-bit mode to be able to use it. In the VB.NET IDE, that's done with Project + Properties, Compile tab, scroll down, Advanced Compile Options, set Target CPU to "x86".

The ultimate troubleshooting tool for problems like this is SysInternals' ProcMon utility. It shows you how COM is using the HKLM\Software\Classes\CLSID key to search for the DLL to load.


You're registering the interop, but (as the error message suggests) you've not registered the COM DLL. Try this:

regsvr32 pdcclient.dll
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜