Question

I have a service that loads a bunch of assemblies as plugins. Each of these plugins reference a common assembly that is installed in the GAC. For some reason, some of the plugins are able to successfully load the assembly from the GAC, but others fail. I can't seem to figure out why this would be happening. Here is the Fusion log for one that works and on that doesn't:

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

Failed:

*** 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.
Was it helpful?

Solution

Failed assembly is not strongly signed (PublicKey=null). I don't know why the assembly is not signed, but there is no need for loader to look in the GAC for such assembly as only strongly signed assemblies can go into the GAC.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top