C # dll binding to another version

I have just restarted a project where I am using NHibernate. The project worked fine the last time I used it, but now it gives the following error.

System.IO.FileLoadException: Could not load file or assembly 'Iesi.Collections, Version = 1.0.0.3, Culture = neutral, PublicKeyToken = aa95f207798dfdb4' or one of its dependencies. the installed assembly manifest definition does not match the assembly Help. (Exception from HRESULT: 0x80131040) at NHibernate.Cfg.Configuration.Reset () at NHibernate.Cfg.Configuration..ctor (SettingsFactory settingsFactory) at NHibernate.Cfg.Configuration..ctor () at Luther.Dao.Repositories.Session. NHibernateHelper..cctor () in NHibernateHelper.cs: line 18

I noticed that the current reference to iesi.dll is 1.0.1.0. What's the best way to get back to work? Try to find the appropriate DLL version or sort your manifest file?

+2


a source to share


1 answer


Have you updated one of the assemblies in your project since you last run this application? It looks like NHibernate was built against version 1.0.0.3 and you currently have 1.0.1.0.

You have to use BindingRedirect in your App.config (or web.config if necessary) to instruct the .NET Framework to satisfy the dependency with a different version. Sort of



<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Iesi.Collections" 
                          publicKeyToken="aa95f207798dfdb4"
                          culture="neutral" />
          <bindingRedirect oldVersion="1.0.0.3"
                           newVersion="1.0.1.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

      

+4


a source







All Articles