.NET, Archive, ASP.NET, Javascript, Visual Studio
     

Visual Studio 2005 and .NET 3.5 Don’t Play Well Together

As many of you have, I also have experimented with the pre-releases of .NET 3.5 and Visual Studio codenamed Orcas. I, for better or worse, installed this pre-release software on my primary development machine which has Visual Studio 2005.

Despite having .NET 3.5 installed on my machine, my primary development occurred in .NET 2.0 via Visual Studio 2005. I had not experienced any problems with this setup until the other day. While attempting to build and publish an ASP.NET 2.0 website with AJAX extensions, I ran into a cryptic server error when executing the site on a staging server. The error was:

Could not load file or assembly 'System.Web.Extensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 
or one of its dependencies. The system cannot find the file specified.

The System.Web.Extensions assembly is the ASP.NET AJAX assembly, so at first I simply thought that the staging server did not have AJAX extensions installed. After installing the AJAX extensions, the issue remained unresolved. A quick look in the machine’s GAC showed that it had version 1.0.61025.0, which is the latest version. Inspection of my development machine’s GAC showed both 1.0.61025.0 and 2.0.0.0 installed.

At this point I was puzzled how my machine had an unofficial version of AJAX extensions, and how my website was referencing it. Next I looked at the web.config of my site to see if I could just change the referenced version to 1.0. However, inspection of the web.config reveled:


<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
</add>

As it turned out, I was already explicitly referencing the correct version. As you can imagine, at this point I was extremely puzzled. I even attempted a few cleans and rebuilds of the site, but to no avail. After some time, I realized that the 2.0.0.0 version of System.Web.Extensions was something that shipped with .NET 3.5, and despite my explicit reference to 1.0.61025.0 Visual Studio 2005 was linking against this other version. The only way to resolve this issue was to uninstall Visual Studio codenamed Orcas and .NET 3.5.

I do not know if the fault lies with Visual Studio 2005, or something with the .NET 3.5 framework. But, whichever component is at fault, I hope that this issue is resolved before the final version of .NET 3.5 ships.

Never miss an article! Subscribe to my newsletter and I'll keep you updated with the latest content.

 

About Jason

Jason is an experienced entrepreneur & software developer skilled in leadership, mobile development, data synchronization, and SaaS architecture. He earned his Bachelor of Science (B.S.) in Computer Science from Arkansas State University.
View all posts by Jason →

Leave a Reply

Your email address will not be published. Required fields are marked *