Recently I deployed an ASP.Net application to a production server and received an error message that began, “Could not load file or assembly ‘System.Web.Extensions…'”.
The Reason for the Error
The application uses Microsoft ASP.NET 2.0 AJAX Extensions 1.0, but they had not been installed on the production machine.
The Obvious Solution
The obvious solution was to download the ‘ASPAJAXExtSetup.msi‘ installer from Microsoft and run it on the live server. The required .dll files would then be inserted into the GAC.
The production machine is a Windows 2000 server. In order to access these files, the IIS instance on the server would need to be restarted. Unfortunately, this was not an option. The target server hosts various applications that cannot be brought down without disrupting the users.
The Final Solution
The development machine did not exhibit the problem, so this machine obviously had the dll files present. The simple answer is to place a copy of these files in the application’s ‘bin’ folder on the production server. When I did this, the error message went away immediately.
So, what files did I need, and where did I find them?
Well, since the installer copies the dlls into the GAC, they can obviously be found there.
For reference, the GAC on my machine is at:
Unfortunately, you can’t see the individual files using Windows Explorer. However, the files can be viewed using the command prompt. It is a bit of a messy process, but it is possible to use the Command Prompt to extract the files.
The good news is that there is an easier way. A colleague pointed out that the installer also places another copy of these files outside the GAC. From this location, they can simply be copied and pasted into the bin folder of the target application.
On my machine the required files are here:
C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\
The files I needed were:
Many thanks to GK for pointing this out to me.