In my previous post I discussed a problem of developing ASP.NET 2.0 applications in Visual Studio 2005, while having the .NET 3.5 framework installed. In summation, the issue was because Visual Studio 2005 was linking against a library that shipped with .NET 3.5 instead of the explicitly referenced version from the web.config.
The comments of one reader of my previous post mentioned using binding redirection to resolve the issue. In short, it looks like they were correct. As best as I can tell, binding redirection does in fact fix this issue.
Binding redirection is the ability to take a pre-compiled application and tell the loader to link against a different version of a library than the application was originally built with. In our case, we would need to add the following configuration to our web.config.
<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="2.0.0.0" newVersion="1.0.61025.0"/> </dependentAssembly> </assemblyBinding> </runtime>
The above configuration tells .NET to use System.Web.Extensions version 1.0.61025 instead of version 2.0.0.0. While the above does pose to be a solution to the problem, it is concerning that this would be needed at all.