regasm 和 tlb(注册 .NET 库以实现 COM 互操作)

发布于 2024-09-06 11:28:56 字数 281 浏览 0 评论 0原文

我有 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清晨说晚安 2024-09-13 11:28:56

我必须用 [ComVisible(true)] 标记我的公共类型。

I had to mark my public type with [ComVisible(true)].

心意如水 2024-09-13 11:28:56

有两件事可以帮助:

  1. 我认为 VS2008 对象浏览器不允许查看从 .NET 程序集生成的 tlb 文件 - 我建议使用 iTripoli 的类型库查看器,以确保您诊断出正确的问题;
  2. 尝试使用 /verbose 选项,看看 Regasm 遇到了什么样的问题。

Two things to help:

  1. I don't think that VS2008 object browser allows viewing of tlb files generated from .NET assemblies - I would recommend using iTripoli's Type Library Viewer to make sure that you are diagnosing the right problem;
  2. Try using the /verbose option, to see what kind of problems Regasm has encountered.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文