在哪里可以找到 MS ActiveX 数据对象 (ADOR) 主互操作程序集 (PIA)?

发布于 2024-09-16 04:15:32 字数 606 浏览 7 评论 0原文

我正在尝试为引用 Microsoft ActiveX 数据对象 (MDAC 2.8) 的项目之一生成主互操作程序集。通过 Visual Studio 中的“引用”对话框添加此库会将 Interop.ADOR.dll 文件添加到解决方案的 bin 目录中。

但是,当我运行 tlbimp.exe 时,出现错误:

C:\Solution> tlbimp Component.dll /out: My.Interop.Component.dll /keyfile:myKeyFile
.snk /primary

Microsoft (R) .NET Framework Type Library to Assembly Converter 3.5.30729.1
Copyright (C) Microsoft Corporation.  All rights reserved.

TlbImp : error TI0000 : System.ApplicationException - Referenced type library 'A
DOR' does not have a primary interop assembly registered.

我无法在网上找到任何内容,这很奇怪。有什么想法吗?

I'm trying to generate a Primary Interop Assembly for one of my projects that references Microsoft ActiveX Data Objects (MDAC 2.8). Adding this library through the References dialog box in Visual Studio adds the Interop.ADOR.dll file to the bin directory of the solution.

However, when I run tlbimp.exe I get the error:

C:\Solution> tlbimp Component.dll /out: My.Interop.Component.dll /keyfile:myKeyFile
.snk /primary

Microsoft (R) .NET Framework Type Library to Assembly Converter 3.5.30729.1
Copyright (C) Microsoft Corporation.  All rights reserved.

TlbImp : error TI0000 : System.ApplicationException - Referenced type library 'A
DOR' does not have a primary interop assembly registered.

I was unable to find anything online, which is odd. Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

绝不服输 2024-09-23 04:15:32

只需删除 tlbimp.exe 的 /primary 参数即可。为您自己的组件生成 PIA 没有什么意义。最好避免将使用 ADOR 类型的类成员公开,这样组件的用户就必须引用它并使用相同的 ADOR PIA。

如果您确实想这样做,那么您必须首先为 msador15.dll 生成 PIA 并注册它。我很确定微软不会发布这样的产品。您还必须部署它们。

Just drop the /primary argument for tlbimp.exe. There's little point in generate PIAs for your own components. Making members of your classes public that use an ADOR type is best avoided, you'll saddle the user of your component with having to have a reference to it as well and use the same ADOR PIA.

If you really want to do this then you'll have to generate a PIA for msador15.dll first and register it. I'm pretty sure that Microsoft doesn't ship one. You'll also have to deploy them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文