在哪里可以找到 MS ActiveX 数据对象 (ADOR) 主互操作程序集 (PIA)?
我正在尝试为引用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需删除 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.