Share via


Could not load file or assembly 'System.Web.Extensions

Question

Wednesday, January 10, 2007 7:57 PM

I am testing AJAX.  I've downloaded the AJAX Extension and the CTP December package and installed on BOTH my development machine and the production server. 

Then I created a very very simple web application, which contains a button and a label.  When the button is clicked, some message is shown on the label.  That's it.

 The AJAX works great on my development machine, but on the production server, I got the typical error as follows: 

Server Error in '/' Application.


Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

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

Source Error:

Line 36:     <compilation debug="false">
Line 37:       <assemblies>
Line 38:         <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
Line 39:       </assemblies>
Line 40:     </compilation>

I searched this forum, one guy mentioned that Microsoft.Web.Extensions.dll and Microsoft.Web.Extensions.Design.dll need to stay in the bin folder of the application.  I don't think this is true any more.  That said, I still tried it, with no luck on the production server.

Could you please help diagnose what might be wrong with the production server side?  Thanks.

All replies (27)

Wednesday, January 10, 2007 9:28 PM

Get rid of the Microsoft.Web.*.dll's

You should be able to stick the System.Web.Extensions.dll from your local machine into the bin folder on production.

You can verify that the dll's exist looking in C:\Windows\assembly\


Wednesday, January 10, 2007 9:51 PM

if you have old version, then uninstall it first

make sure you reference it

use latest web.config provided by Microsoft ASP.NET 2.0 AJAX Extensions

make sure GAC has system.web.extensions and system.web.extensions.design

 


Thursday, January 11, 2007 2:10 AM

Thanks a lot for both of you guys.

Yes, I did uninstall the older versions and reinstalled the new ones.

 I just verified that the Windows\assembly folder on both machines.  Both have System.Web.Extensions.dll and System.Web.Extensions.Design.dll as shown here

http://farm1.static.flickr.com/154/353243449_b2e738de6d.jpg?v=0

and here

http://farm1.static.flickr.com/141/353243445_1aba60e2b2.jpg?v=0

Please read on, something weird is going on.

I have Visual Web Developer (VWD hereafter) 2005 Express installed on the PRODUCTION server, too.  So, I launched the VWD on the production server and created the same kind of test application. Application files are saved on C:\Documents and Settings\myHomeDir\Websites\AjaxTest\

Then I launch this application from the VWD built-in web server.  The AJAX works great (i.e., http://localhost:3634/AjaxTest/Default.aspx)!  Then, I copied the entire application to Drive F, home of our production web applications, and then I checked out the application through http://www.mycompany.com/AjaxTest/Default.aspx.  Well, it no longer complains about anything, but the AJAX does NOT work!

Look, it's the same aspx file, the same cs code, the same web.config, on the same host (running windows 2003 server + IIS 6.0) in different partitions of the hard drive, but it works with the VWD built-in web server, it refuses to work with the production server.  Could you explain this?

I put a very lengthy junkie passage before the button, and when I test it, I shrinked the IE/Firefox browser window, so if the AJAX works (in which case, the entire page is not reloaded), the right-hand side scroll bar of the browser will stay as before, and if it does not work (in which case, the entire page will be reloaded) the cursor will be repositioned at the top of the page and thus the scroll bar goes to the very top as well.  I put this here, just in case you guys ask "are you sure it is not working on your production server?"

 BTW, I tried creating a virtual directory for AjaxTest folder on the production server, it did not help.

Please kindly share your wisdom.  Thanks again.
 


Friday, January 12, 2007 2:04 PM

**antonyliu2002 what is the error you are getting on the production server?
**


Saturday, June 23, 2007 5:52 PM

Hello,
I was reading over your post and I too was experiencing this issue. If you have not yet resolved this issue then you may do the following.

Navigate to the ASP.NET AJAX 1.0 Installer Package found at ( http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&displaylang=en )

Download and install on your production server (Mine is WS 2003).

This will install all required DLL files in your Win/Assemblies/ folder on your server, which is what your config file is looking for. This resolved my issue and have not found any problems in doing so.

 


Tuesday, July 24, 2007 10:52 AM

Another solution I found is to place System.Web.Extensions.dll and System.Web.Extensions.Design.dll directly in the Bin folder of your web app.


Tuesday, August 21, 2007 1:51 PM

After installing it, I had to do a reboot then the error finally disappeared. 


Tuesday, January 29, 2008 5:03 AM

I had this same error, I tried the below but it did not help at all.

Hello,
I was reading over your post and I too was experiencing this issue. If you have not yet resolved this issue then you may do the following.

Navigate to the ASP.NET AJAX 1.0 Installer Package found at ( http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&displaylang=en )

Download and install on your production server (Mine is WS 2003).

This will install all required DLL files in your Win/Assemblies/ folder on your server, which is what your config file is looking for. This resolved my issue and have not found any problems in doing so.

 

But the below did work, thank you Stevishere!

Another solution I found is to place System.Web.Extensions.dll and System.Web.Extensions.Design.dll directly in the Bin folder of your web app.


Monday, March 10, 2008 11:09 AM

Glad I could finally provide help to someone else!


Friday, July 11, 2008 1:09 PM

After installing it, I had to do a reboot then the error finally disappeared. 

 

It should work just as well to restart the "World Wide Web Publishing" Service so you don't have to bring the whole server down.


Wednesday, July 16, 2008 3:23 AM

I was facing the same problem, this is what i did.

1) Install AJAX 1.0 on the production server.

2) reset the iis server using iisreset.

hope this helps.

 


Wednesday, July 16, 2008 4:07 PM

Check that the version matches with the DLLs in your GAC. If you installed .Net 3.5 the version should be 3.5.0.0, not 1.0.61025.0.


Friday, September 19, 2008 3:08 PM

I had the same error when I published my web app to the production server.  I checked the reference path in Visual Studio, it showed that the dll was from .Net Framework 3.5, I installed it, and it fixed the problem.


Monday, October 20, 2008 3:39 PM

I had the exact same error when I installed ajax 1.0 for .net 2.0 onto the production server.

For me, it was solved by doing an IIS restart, without restarting the server.


Wednesday, October 22, 2008 4:13 AM

Hey, Thankyou all,

After installing the ASPAJAXExtSetup.msi it works.


Friday, January 16, 2009 10:36 AM

Hi!

I think that you can have a different version on disk than defined in your web.config To resolve do like this:

  • Go to directory windows\assembly
  • Right-click assembly system.web.extensions
  • Select properties and remember both version and public key token
  • Open web.config in notepad
  • Search for all system.web.extensions items
  • Verify that the public key token is the same as earlier identified
  • If  the same key then update version

Friday, March 13, 2009 1:35 PM

 

Another solution I found is to place System.Web.Extensions.dll and System.Web.Extensions.Design.dll directly in the Bin folder of your web app.

 

This worked for me...thanks!


Friday, March 13, 2009 2:03 PM

Great to hear it helped!

Thanks!


Monday, May 4, 2009 4:23 PM

 This has worked with Ajax toolkit from Telerik.com on Visual Studio 2008.  It was giving the same error without the ASP.NET AJAX 1.0 Installer Package.

 Thanks!


Wednesday, August 5, 2009 4:15 PM

Thanks...Changing the version from 1.0.61025.0  into 3.5.0.0 in the web.config file worked for me.


Wednesday, June 2, 2010 3:45 AM

hi am facing am facing same problem .

i am using ajax calender control and using .net frame work 3.5 and i used toolkitscriptmanager not asp script manager

and also system.web.extentions.dll is also available in GAC .but also am getting some error

in web.config file also i added this dll tag but am facing problem

this is error

Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

can u please help me


Wednesday, June 2, 2010 3:50 AM

hi am facing same problem

for that i did what u told that placing dll s before this also the assembly contains this dll's

now also getting same problem

am using this toolkit 

April 2010 Release

so please help me thank you in advance


Wednesday, June 23, 2010 10:44 AM

I had the same problem. I was able to get it to work by changing the version in the web config to 3.5.0.0. However, i dont understand why if both the development and IIS c:\windows\assembly folder has the 3.5.0.0 version, why does it work on development with the web config file showing an older version? Shouldn't i get the same error on development also?


Thursday, December 23, 2010 10:54 AM

I was receiving this same error. In the end it was a version reference issue in the web.config. I checked the version of the System.Web.Extension in C:\Windows\assembly and found that the version was 3.5.0.0, in my web config file as well as in yours it was referencing "Version=1.0.61025.0" I changed this in my web.config to point to the correct version "Version=3.5.0.0" and bingo.


Wednesday, February 16, 2011 3:07 PM

This worked for me on a Win2k3 machine with .net 3.5 SP1.  Got the same error before, installed ASP.NET AJAX 1.0 and the error went away.


Thursday, July 7, 2011 6:13 AM

Check this blog : http://allwrong.wordpress.com/2007/07/17/aspnet-error-could-not-load-file-or-assembly-systemwebextensions/


Thursday, August 22, 2013 8:56 AM

I faced same problem in many scenarios. I have list out solutions which i had used to rid out the problems.

http://dotnettips4all.blogspot.in/2012/08/could-not-load-file-or-assembly_18.html