Jason Whitehorn

MarshalByRefObject.net
posts - 50, comments - 26, trackbacks - 6

My Links

News

Archives

Post Categories

.NET

Java

Proud Member Of...

XNA

A Possible Solution To The .NET 3.5/Visual Studio 2005 Feud

UPDATE (12/17/2007): My blog has moved. This post is now located at: http://jason.whitehorn.ws/2007/07/03/A+Possible+Solution+To+The+NET+35Visual+Studio+2005+Feud.aspx




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.

Print | posted on Tuesday, July 03, 2007 4:12 PM | Filed Under [ .NET ASP.NET ]

Feedback

Gravatar

# re: A Possible Solution To The .NET 3.5/Visual Studio 2005 Feud

Such wisdom, must have gained that through fatherhood.
7/17/2007 12:22 PM | cool guy
Gravatar

# re: A Possible Solution To The .NET 3.5/Visual Studio 2005 Feud

I found this wouldn't work correctly unless I added <publisherPolicy apply="no"/> to the rule. Eg:

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<publisherPolicy apply="no"/>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="3.5.0.0" newVersion="1.0.61025.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
...
</configuration>
8/22/2007 4:29 PM | Sichbo
Comments have been closed on this topic.

Powered by: