Pregunta

Tengo un servicio que carga un montón de ensamblados como complementos. Cada uno de estos complementos hace referencia a un ensamblaje común que se instala en el GAC. Por alguna razón, algunos de los complementos pueden cargar con éxito el ensamblaje del GAC, pero otros fallan. Parece que no puedo entender por qué esto estaría sucediendo. Aquí está el registro de fusión para uno que funciona y eso no:

*** Assembly Binder Log Entry  (12/3/2011 @ 10:54:47 AM) ***



The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

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

=== Pre-bind state information ===
LOG: User = NT AUTHORITY\SYSTEM
LOG: DisplayName = OSAE.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f47a6446f36f79f7
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/OSA/AddIns/ZWave
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : OSAE.Zwave, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: OSAE.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f47a6446f36f79f7
LOG: Found assembly by looking in the GAC.
LOG: Binding succeeds. Returns assembly from C:\Windows\Microsoft.Net\assembly\GAC_MSIL\OSAE.API\v4.0_1.0.0.0__f47a6446f36f79f7\OSAE.API.dll.
LOG: Assembly is loaded in default load context.

Ha fallado:

*** Assembly Binder Log Entry  (12/3/2011 @ 10:54:46 AM) ***

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\Microsoft.NET\Framework\v4.0.30319\AddInProcess.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = NT AUTHORITY\SYSTEM
LOG: DisplayName = OSAE.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/OSA/AddIns/Web Server
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : OSAE.WebServer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files/OSA/AddIns/Web Server/OSAE.API.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/OSA/AddIns/Web Server/OSAE.API/OSAE.API.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/OSA/AddIns/Web Server/OSAE.API.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/OSA/AddIns/Web Server/OSAE.API/OSAE.API.EXE.
LOG: All probing URLs attempted and failed.
¿Fue útil?

Solución

El ensamblaje fallido no está firmemente firmado (PublicKey = NULL). No sé por qué el ensamblaje no está firmado, pero no hay necesidad de que el cargador busque en el GAC para el ensamblaje que solo los ensamblajes fuertemente firmados pueden entrar en el GAC.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top