简体   繁体   English

C#dll上免费注册的COM,VBScript扼流圈

[英]Registration free COM, VBScript chokes on C# dll

I'm trying to get a third party app (hMailServer) to consume my C# library. 我正在尝试获取第三方应用程序(hMailServer)以使用我的C#库。 They support 3rd party libraries using VBScript hooks. 他们使用VBScript钩子支持第三方库。 I got everything working fine using registration-full COM, but now want to use registration free. 使用完全注册的COM,一切正常,但现在想免费使用注册。

I've modified the hMailServer.exe manifest and added a manifest to my C# library. 我已经修改了hMailServer.exe清单,并将清单添加到了C#库中。 Now the hMailServer service starts up just fine and SxS trace shows that the library is found. 现在,hMailServer服务可以正常启动,并且SxS跟踪显示已找到该库。 If I neglect to create my C# library manifest I get an error that "Windows could not start the hMailServer service on Local Computer... because its side by side configuration is incorrect" and sxstrace gives errors so I know the manifests are fine. 如果我忽略了创建C#库清单的操作,则会收到错误消息:“ Windows无法在本地计算机上启动hMailServer服务...,因为其并行配置不正确”,并且sxstrace给出了错误,因此我知道清单是可以的。 However, the VBScript events fail to run with the following error: 但是,VBScript事件无法运行,并出现以下错误:

Script Error: Source(null) - Error: 8013101B - Description(null) - Line: 2 Column: 1 - Code(null) 脚本错误:源(null)-错误:8013101B-说明(null)-行:2列:1-代码(null)

The first 2 lines of the VB6 script just read: VB6脚本的前两行仅显示为:

Dim oHandlers
Set oHandlers = CreateObject("hMailServerPlugins.EventHandlers")

(hMailServerPlugins.EventHandlers is obviously the name of my COM visible class) (hMailServerPlugins.EventHandlers显然是我的COM可见类的名称)

As mentioned, everything works just fine with COM registration. 如前所述,COM注册一切正常。 Any idea what I'm missing? 知道我错过了什么吗?

This may be a bit late, but I've seen this error if you've mixed .Net framework versions. 这可能会有点晚,但是如果您混合使用.Net框架版本,则可能会看到此错误。 If you've spun up a CLR of a lesser version first, then attempts to create a C# COM object using a newer framework after the fact will fail with that exception. 如果您首先启动了一个较小版本的CLR,则在事实将因该异常而失败之后,尝试使用较新的框架创建C#COM对象。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM