I have the following situation:
I have NHibernate 2.1.2.4000 that requires yes or yes Antlr 3.1.1
I did an optimization of the entire web application using minification and bundling techniques with WebGrase that uses Antlr (> = 3.4.1.9004) The performance increased up to 38.8%. For those who wish to learn, here are a couple of links: link and link
I have both Antlr Dlls in parallel.
When I access a driver that uses NHibernate , it throws the following exception:
An exception of type 'System.IO.FileLoadException' occurred in NHibernate.dll but was not handled in user code
Additional information: Could not load file or assembly 'Antlr3.Runtime, Version = 3.1.0.39271, Culture = neutral, PublicKeyToken = 3a9cab8f8d22bfb7 'or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
This error happens because it is referencing the new library of ANTLR and what I need is to travel through time and make use of the old library.
web.config
without success so far. Data:
<Reference Include="antlr.runtime, Version=2.7.7.3, Culture=neutral, PublicKeyToken=d7701e059243744f">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dependencies\Antlr.3.1.1\lib\antlr.runtime.dll</HintPath>
</Reference>
<Reference Include="Antlr3.Runtime, Version=3.4.1.9004, Culture=neutral, PublicKeyToken=eb42632606e9261f, processorArchitecture=MSIL">
<HintPath>..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Antlr3.Utility, Version=0.1.0.39272, Culture=neutral, PublicKeyToken=3a9cab8f8d22bfb7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dependencies\Antlr.3.1.1\lib\Antlr3.Utility.dll</HintPath>
</Reference>
<Reference Include="NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Dependencies\NHibernate.dll</HintPath>
</Reference>
Some of the bindings I tried were:
Using the NHibernate token:
<dependentAssembly>
<assemblyIdentity name="antlr.runtime" publicKeyToken="aa95f207798dfdb4" Culture="neutral" />
<bindingRedirect oldVersion="3.1.0.39271" newVersion="3.4.1.9004" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" Culture="neutral" />
<bindingRedirect oldVersion="3.1.0.39271" newVersion="3.4.1.9004" />
</dependentAssembly>
Using the Antlr token (and traveling in time):
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="d7701e059243744f" Culture="neutral" />
<bindingRedirect oldVersion="3.4.1.9004" newVersion="3.1.1.0" />
</dependentAssembly>
I will continue looking for a solution in the meantime, when I find it I share it: D