Binding Redirect

727 views Asked by At

Need to reference a library 'configit.Base.dll' from one of my projects. Unfortunately my project already use Ionic.Zip.dll version 1.9.3.0 and it seem like configit.Base.dll needs version 1.9.1.8 of Ionic.Zp.dll, so when I try to run my program I get a load error. I've tried to add the following to mu .config file:

  <dependentAssembly>
    <assemblyIdentity name="Ionic.Zip" publicKeyToken="edbe51ad942a3f5c" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-1.9.1.8" newVersion="1.9.3.0" />
  </dependentAssembly>

without any success. If I run fuselogwv I get the following:

=== Pre-bind state information ===
LOG: DisplayName = Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c
(Fully-specified)
LOG: Appbase = file:///C:/Local/Projects/Playground/ConfigItLoad1/ConfigItLoad1/bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = ConfigItLoad1.exe
Calling assembly : Configit.Base, Version=2.0.0.111, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Local\Projects\Playground\ConfigItLoad1\ConfigItLoad1\bin\Debug\ConfigItLoad1.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Local/Projects/Playground/ConfigItLoad1/ConfigItLoad1/bin/Debug/Ionic.Zip.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Local\Projects\Playground\ConfigItLoad1\ConfigItLoad1\bin\Debug\Ionic.Zip.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: Ionic.Zip, Version=1.9.3.0, Culture=neutral, PublicKeyToken=null
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
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.

does this mean that Ioniz.Zip 1.9.3.0 is so different from 1.9.1.8, that it can't be loaded??

TIA

/Søren

2

There are 2 answers

0
Amit On

Check in CSPROJ file. If any version specified, remove it.

0
Matthew K On

This does not mean that Ioniz.Zip 1.9.3.0 is so different from 1.9.1.8, that it can't be loaded.

The following line suggests the binding redirect did not occur:

LOG: Post-policy reference: Ionic.Zip, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c

Ensure your config entry is properly formatted (MSDN) and located in

C:\Local\Projects\Playground\ConfigItLoad1\ConfigItLoad1\bin\Debug\ConfigItLoad1.exe.Config

or your machine.config.