【问题标题】:Where can I find MS ActiveX Data Object (ADOR) Primary Interop Assembly (PIA)?在哪里可以找到 MS ActiveX 数据对象 (ADOR) 主互操作程序集 (PIA)?
【发布时间】:2011-04-03 08:51:33
【问题描述】:

我正在尝试为我的一个引用 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.

我在网上找不到任何东西,这很奇怪。有什么想法吗?

【问题讨论】:

    标签: .net interop com+ pia primary-interop-assembly


    【解决方案1】:

    只需删除 tlbimp.exe 的 /primary 参数。为您自己的组件生成 PIA 没有什么意义。最好避免将使用 ADOR 类型的类的成员公开,因为您将不得不对组件的用户进行引用并使用相同的 ADOR PIA。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-30
      • 2015-06-21
      • 2020-01-30
      • 2017-02-16
      相关资源
      最近更新 更多