Could not load file or assembly 'AvalonWizard, PublicKeyToken=null' or one of its dependencies


My C# App has a reference to AvalonWizard dll. The AvalonWizard dll is strongly signed with a PublicKeyToken = 8f2c89e926618269. However, my app when is loading the AvalonWizard dll, is trying to load an assembly with PublicKeyToken = null and therefore there is the following error:

FileLoadException: Could not load file or assembly 'AvalonWizard, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I don't understand why my app is trying to load the dll with public key token null, as in the .csproj is referenced the one strongly signed:

<Reference Include="AvalonWizard, Version=, Culture=neutral, PublicKeyToken=8f2c89e926618269, processorArchitecture=MSIL">

I have checked also the assembly blind log entry, and this is the result:

 *** Assembly Binder Log Entry  (14/08/2018 @ 10:53:09) ***

The operation failed.
Bind result: hr = 0x80131040. No description available.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Users\vicent.rico\Documents\GitHub\KNXPM\TestApp\bin\Debug\TestApp.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = AvalonWizard, Version=, Culture=neutral, PublicKeyToken=null
LOG: Appbase = file:///C:/Users/vicent.rico/Documents/GitHub/KNXPM/TestApp/bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = TestApp.exe
Calling assembly : PresentationFramework, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\vicent.rico\Documents\GitHub\KNXPM\TestApp\bin\Debug\TestApp.exe.Config
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:/Users/vicent.rico/Documents/GitHub/KNXPM/TestApp/bin/Debug/AvalonWizard.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\vicent.rico\Documents\GitHub\KNXPM\TestApp\bin\Debug\AvalonWizard.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: AvalonWizard, Version=, Culture=neutral, PublicKeyToken=8f2c89e926618269
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: The assembly reference did not match the assembly definition found.
ERR: Run-from-source setup phase failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Any ideas where else I can check? What I don't understand is why my app is looking for the dll with null public key token.

asked on Stack Overflow Aug 14, 2018 by chincheta73 • edited Aug 14, 2018 by chincheta73

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0