I spent the evening troubleshooting an issue, where we needed redirect some assemblies from one version to another – something that might happen to you, if you use Fluent NHibernate and the Castle Project in the same assembly.
The project had a reference to Castle.Core.dll version 2.2.0.0, but Fluent NHibernate requires version 2.1.0.0 of the same file. We set up the redirect in web.config, but still got an exception at runtime, telling us that we needed version 2.1.0.0 of the file.
The cause: We had forgotten the ever so important namespace for the assemblyBinding element in web.config!
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Castle.Core"
publicKeyToken="407dd0808d44fbdc"></assemblyIdentity>
<bindingRedirect oldVersion="1.1.0.0"
newVersion="1.2.0.0"></bindingRedirect>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Castle.DynamicProxy2"
publicKeyToken="407dd0808d44fbdc"></assemblyIdentity>
<bindingRedirect oldVersion="2.1.0.0"
newVersion="2.2.0.0"></bindingRedirect>
</dependentAssembly>
</assemblyBinding>
</runtime>
Do’h.
c8b9e0cb-4c1b-4d37-976d-7516c7d4a2d4|1|5.0
.NET, ASP.NET
.net, asp.net