regasm 和 tlb(注册 .NET 库以实现 COM 互操作)
我有 .NET 程序集,其中包含一个公共类和多个私有类。
我正在尝试将其注册为 COM 互操作,以便可以使用以下命令从 VBA 调用它:
regasm /tlb foo.dll /codebase
随后,当我打开 .tlb 时在 Visual Studio 的“对象浏览器”中查看
文件,我看到该库没有公开任何类型。
有什么想法吗?
我意识到这里没有太多具体信息,所以如果您让我知道什么对诊断有用,我会尽力提供。
I have .NET assembly with one public class and several private classes.
I am trying to register it for COM interop so that I can call it from VBA, using the following command:
regasm /tlb foo.dll /codebase
Subsequently, when I open up the .tlb
file in Visual Studio's "object browser", I see that the library does not expose any types.
Any thoughts?
I realize that there isn't much specific information here, so if you let me know what would be diagnostically useful, I will try to provide.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我必须用
[ComVisible(true)]
标记我的公共类型。I had to mark my public type with
[ComVisible(true)]
.有两件事可以帮助:
/verbose
选项,看看Regasm
遇到了什么样的问题。Two things to help:
/verbose
option, to see what kind of problemsRegasm
has encountered.