2016-07-22 12 views
0

Wir treiben ein Vermächtnis Windows-Dienst, der ursprünglich für Windows 2003 auf einem Windows 2012 R2 Server zum Testen jedoch geschrieben wurde, als wir den Installer .msi laufen versuchen, werden wir den folgenden Fehler zu erhalten:Windows-Dienstinstallationsfehler: Fehler 1001, Assembly-Typen können nicht in der C: Programme .. .. xxx.dll-Assembly abgerufen werden.

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. 

es scheint, dass es ein Problem mit einem Oracle.DataAccess DLL sein kann:

Oracle Error

Der Log Viewer diese Informationen zur Verfügung gestellt:

*** 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. 

ich sicher, dass beide versuchen: für Oracle.DataAccess.dll

jedoch

  1. Kopieren einer lokalen Kopie von Oracle.DataAccess.dll
  2. Mit einem Verweis auf die GAC weder schien arbeiten.

    Wir haben mehrere andere Windows-Dienste bereitgestellt, die sich auf diese DLL beziehen, und hatten keine Probleme.

    Danke.

+0

Haben Sie versucht [dies] (http://stackoverflow.com/a/1648302/5794617) und [dies] (http://forums.asp.net/t/2006795.aspx?Could+not+load + Datei + oder + Assembly + Datei + oder + ein + von + seine + Abhängigkeiten + Das + System + kann + die + Datei + nicht finden + spezifiziert und [diese] (http://stackoverflow.com/questions/11030500/ assembly-binding-error-bind-result-hr-0x80070002-das-system-kann nicht finden-the)? –

Antwort

1

Es wird sehr wahrscheinlich ein Bitness-Problem sein, wie diese Links implizieren. Ich werde hier einige zusätzliche Informationen hinzufügen.

Die Installer-Klasse in der Installer-Assembly wird nicht direkt aufgerufen. Es gibt eine C++ - DLL, die Ihr MSI zuerst aufruft, und diese lädt eine Version der NET-Laufzeit und instanziiert dann Ihre Klassenmethode für benutzerdefinierte Aktionsmodule durch Reflektion (deshalb sehen Sie Ihre Assembly nicht in FusionViewer). Local kopieren spielt während der Installation keine Rolle - es werden GAC-Baugruppen geladen. Abgesehen davon, dass sie durch Reflektion instanziiert wird, wird Ihre CA-Assembly von einem msiexec.exe-Prozess aufgerufen und lädt keine Konfigurations- oder Einstellungsdateien, die Sie haben, oder kümmert sich anderweitig darum, wo sie läuft (zum Beispiel gibt es kein Arbeitsverzeichnis der Assembly) Lage).

Die Kette der Bitness wird kompliziert - Ihre Einrichtung kann x86 oder x64 sein, Ihre benutzerdefinierte Aktion Dll kann x86, x64 oder AnyCpu sein. Es wird versuchen, Abhängigkeiten zu laden, die nicht übereinstimmen. Wenn es sich um eine x86-Installation handelt, erstellen Sie Ihre Installer-Klasse für x86 und stellen Sie sicher, dass alles, was sie aufruft, für x86 erstellt wird. Die gleiche Idee, wenn es x64 ist. Eine mögliche Erklärung ist, dass es sich bei Server 2012 um eine 64-Bit-Version handelt und dass Ihre CA-Assembly nativ ausgeführt wird und nach 32-Bit-Oracle-Assemblys sucht.

1

Unsere Umgehungsmöglichkeit für dieses Problem nach dem Sprechen mit Microsoft Support bestand darin, Orca zu verwenden, um die InstallUtilLib.dll zu überschreiben, auf die im 32-Bit-.Net-Framework-Verzeichnis verwiesen wird.

Mithilfe von Orca konnten wir die MSI auf das Verzeichnis c: \ Windows \ Microsoft.Net \ Framework64 verweisen.

  1. Öffnen Sie das Ergebnis.msi in Orca aus dem Windows Installer SDK
  2. Wählen Sie die Tabelle Binary
  3. Doppelklicken Sie auf die Zelle [Binärdaten] für die Aufzeichnung InstallUtil
  4. Achten Sie darauf, „Lesen von Dateinamen binär“ ausgewählt ist, und klicken Sie auf die Schaltfläche Durchsuchen
  5. Navigieren Sie zu% windir% Microsoft.NET \ Framework64 \ v4.0.30319
  6. Select InstallUtilLib.dll
  7. Klicken Sie auf die Schaltfläche Öffnen
  8. Klicken Sie auf die Schaltfläche OK

Sobald wir diese Schritte befolgt hatten, konnten wir den Windows-Dienst installieren.

Wir hatten mehrere andere Windows-Dienste, die wir ohne Probleme auf Windows 2012R2 bauten und auf diese aktualisierten. Aus irgendeinem Grund war dies der einzige Dienst, der diese Problemumgehung erforderte.

Ich hoffe, das hilft jemandem.

Danke.

Verwandte Themen