【问题标题】:Windows Service Installation Error: Error 1001, Unable to get installer types assembly in the C:\Program Files\..\..\xxx.dll assembly.Windows 服务安装错误:错误 1001,无法在 C:\Program Files\..\..\xxx.dll 程序集中获取安装程序类型程序集。
【发布时间】:2016-07-22 21:32:20
【问题描述】:

我们正在将最初为 Windows 2003 编写的旧版 Windows 服务推送到 Windows 2012 R2 Server 进行测试,但是当我们尝试运行安装程序 .msi 时,我们收到以下错误:

Error 1001, Unable to get installer types assembly in the C:\Program   Files\..\..\xxx.dll assembly. -> . Unable to load one or more of the requested   types. Retrieve the LoaderExceptions property for more information.

看来这可能是 Oracle.DataAccess DLL 的问题:

日志查看器提供了以下信息:

    *** Assembly Binder Log Entry  (7/22/2016 @ 1:54:54 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Windows\syswow64\MsiExec.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
 (Fully-specified)
LOG: Appbase = file:///C:/Windows/syswow64/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MsiExec.exe
Calling assembly : CTMSRenewalOutboundService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: No application configuration file found.
LOG: Using host configuration file: C:\Temp\CFG4155.tmp
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\PPD\CTMSOutboundService\Oracle.DataAccess.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
ERR: Invalid assembly platform or ContentType in file (hr = 0x8007000b).
ERR: Run-from-source setup phase failed with hr = 0x8007000b.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess/Oracle.DataAccess.EXE.
LOG: All probing URLs attempted and failed.

*** Assembly Binder Log Entry  (7/22/2016 @ 1:54:54 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Windows\syswow64\MsiExec.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
 (Fully-specified)
LOG: Appbase = file:///C:/Windows/syswow64/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MsiExec.exe
Calling assembly : CTMSRenewalOutboundService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: No application configuration file found.
LOG: Using host configuration file: C:\Temp\CFG4155.tmp
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\PPD\CTMSOutboundService\Oracle.DataAccess.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
ERR: Invalid assembly platform or ContentType in file (hr = 0x8007000b).
ERR: Run-from-source setup phase failed with hr = 0x8007000b.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess/Oracle.DataAccess.EXE.
LOG: All probing URLs attempted and failed.

*** Assembly Binder Log Entry  (7/22/2016 @ 4:01:10 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Windows\syswow64\MsiExec.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
 (Fully-specified)
LOG: Appbase = file:///C:/Windows/syswow64/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MsiExec.exe
Calling assembly : CTMSRenewalOutboundService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: No application configuration file found.
LOG: Using host configuration file: C:\Temp\CFGDA59.tmp
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\PPD\CTMSOutboundService\Oracle.DataAccess.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
ERR: Invalid assembly platform or ContentType in file (hr = 0x8007000b).
ERR: Run-from-source setup phase failed with hr = 0x8007000b.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess/Oracle.DataAccess.EXE.
LOG: All probing URLs attempted and failed.

*** Assembly Binder Log Entry  (7/22/2016 @ 4:01:10 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Windows\syswow64\MsiExec.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
 (Fully-specified)
LOG: Appbase = file:///C:/Windows/syswow64/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = MsiExec.exe
Calling assembly : CTMSRenewalOutboundService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: No application configuration file found.
LOG: Using host configuration file: C:\Temp\CFGDA59.tmp
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Windows/syswow64/Oracle.DataAccess/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Program Files\PPD\CTMSOutboundService\Oracle.DataAccess.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Oracle.DataAccess, Version=4.112.4.0, Culture=neutral, PublicKeyToken=89b483f429c47342
ERR: Invalid assembly platform or ContentType in file (hr = 0x8007000b).
ERR: Run-from-source setup phase failed with hr = 0x8007000b.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess/Oracle.DataAccess.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/PPD/CTMSOutboundService/Oracle.DataAccess/Oracle.DataAccess.EXE.
LOG: All probing URLs attempted and failed.

我确保两者都试了:

  1. 复制 Oracle.DataAccess.DLL 的本地副本
  2. 使用对 Oracle.DataAccess.DLL 的 GAC 的引用

但似乎两者都不起作用。

我们已经部署了几个引用此 DLL 的其他 Windows 服务,并且没有任何问题。

谢谢。

【问题讨论】:

标签: c# oracle windows-services windows-installer installation


【解决方案1】:

正如这些链接所暗示的那样,这很可能是一个位问题。我将在这里添加一些额外的信息。

安装程序程序集中的安装程序类不是直接调用的。您的 MSI 首先调用了一个 C++ Dll,它会加载一个 NET 运行时版本,然后通过反射实例化您的自定义操作安装程序类方法(这就是您在 FusionViewer 中看不到程序集加载的原因)。在安装过程中复制本地无关紧要 - 它会加载 GAC 程序集。除了通过反射实例化之外,您的 CA 程序集是从 msiexec.exe 进程调用的,并且不会加载您拥有的任何配置或设置文件,或者不关心它从哪里运行(例如,没有程序集的工作目录地点)。

位链变得复杂 - 您的设置可能是 x86 或 x64,您的自定义操作 Dll 可能是 x86、x64 或 AnyCpu。它将尝试加载可能不匹配的依赖项。如果是 x86 安装,请为 x86 构建安装程序类,并确保它调用的任何内容都是为 x86 构建的。如果它是 x64,则同样的想法。因此,一种可能的解释是 Server 2012 是 64 位的,而您的 CA 程序集正在本地运行并正在寻找 32 位 Oracle 程序集。

【讨论】:

    【解决方案2】:

    在与 Microsoft 支持人员交谈后,我们对此问题的解决方法是使用 Orca 覆盖在 32 位 .Net 框架目录中引用的 InstallUtilLib.dll。

    通过使用 Orca,我们能够将 msi 指向 c:\Windows\Microsoft.Net\Framework64 目录。

    1. 使用 Windows Installer SDK 在 Orca 中打开生成的 .msi
    2. 选择二进制表
    3. 双击记录InstallUtil的单元格[Binary Data]
    4. 确保选中“从文件名读取二进制文件”并单击“浏览”按钮
    5. 浏览到 %WINDIR%Microsoft.NET\Framework64\v4.0.30319
    6. 选择 InstallUtilLib.dll
    7. 点击打开按钮
    8. 点击确定按钮

    按照这些步骤,我们就可以安装 Windows 服务了。

    我们构建并升级到 Windows 2012R2 的其他几个 Windows 服务没有任何问题。出于某种原因,这是唯一需要此解决方法的服务。

    希望这对某人有所帮助。

    谢谢。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-10-09
      • 2011-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-05
      相关资源
      最近更新 更多