注册/加载64位.net dll时出现问题



我有一个VB客户端应用程序,调用VB进程内COM服务器myprogressbar

(是的,这是VB调用VB的一种反常的方式,但客户端是一个测试工具-在生产代码中,客户端不是VB,需要使用COM)。

Dim progressbar As Object = CreateObject("myprogressbar.myprogressbar")
progressbar.showform()

错误

System.Exception: cannot create ActiveX component .

x86服务器已注册(成功)到

c:WindowsMicrosoft.NETFrameworkv4.0.30319RegAsm.exe x86Releasemyprogressbar.dll

x64服务器(成功)注册到

c:WindowsMicrosoft.NETFramework64v4.0.30319RegAsm.exe x64Releasemyprogressbar.dll

Update:同样的事情发生在编译为Any CPU的单个服务器上。

已解决。

问题是。net程序集,除非加载到GAC中,需要用/c开关注册到regasm(注册到代码库的完整路径),因此可执行文件可以在运行时找到它们。这与默认情况下具有这种行为的regsvr32形成对比。

最新更新