Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

Last post 03-17-2009 3:28 PM by agargye. 27 replies.

Sort Posts:

  • Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-23-2007, 1:40 AM
    • Contributor
      2,273 point Contributor
    • Johnson2007
    • Member since 05-17-2007, 7:19 AM
    • Posts 449

     I developed my asp.net project using VS 2005. My web server is a Windows server 2003 and is installed framework 2.0 and Ajax 1 extension. Everrything works well until I intalled VS 2008 in my development machine.

    My website works fine on my development machine. But when I publish it to my web server, it raise a parser error: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0...

     I used ajax toolkit in my project. First, I found the web.config contained a statement: <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken...>. So I changed it to <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken..>. And also I search through out my project and make sure there is not any where contains <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken...>. And I build my web and publish it to my server again. But the web server still raises the parser error message.

    I could not install framework 3.5 on my web server. What can I do to solve such a problem? Thank you. 

    Johnson
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-23-2007, 3:45 AM
    • All-Star
      45,487 point All-Star
    • jimmy q
    • Member since 11-02-2006, 9:01 AM
    • Australia
    • Posts 3,147
    • Moderator
      TrustedFriends-MVPs

    I had this issue with VS2008 beta as well. It seems like it automatically references the latest AJAX assemblies as if an assembly policy was installed or a bindingRedirect specified.

    I could not resolve it so I had to uninstall VS2008 along with the .NET3.0/3.5 framework to be able to rebuild my .NET 2.0 web site.

  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-23-2007, 5:24 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello.

    yes, a redirect will solve it for you...

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-23-2007, 1:04 PM
    • Star
      13,533 point Star
    • gt1329a
    • Member since 06-23-2002, 8:53 PM
    • Atlanta
    • Posts 2,231
    • ASPInsiders
      TrustedFriends-MVPs

    Post your entire web.config (minus any connection strings), if you don't mind. 

    Encosia - ASP.NET, jQuery, AJAX, and more.

    Latest article: Using jQuery validation with ASP.NET WebForms
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-25-2007, 3:27 AM
    • Contributor
      2,273 point Contributor
    • Johnson2007
    • Member since 05-17-2007, 7:19 AM
    • Posts 449

     Hi all,

    Thank all of you for your replay. Here is the content of my web.config file. Thanks. 

     

    1    <?xml version="1.0"?>
    2    <!-- 
    3        Note: As an alternative to hand editing this file you can use the 
    4        web admin tool to configure settings for your application. Use
    5        the Website->Asp.Net Configuration option in Visual Studio.
    6        A full list of settings and comments can be found in 
    7        machine.config.comments usually located in 
    8        \Windows\Microsoft.Net\Framework\v2.x\Config 
    9    -->
    10   <configuration>
    11   	<appSettings>
    12   	</appSettings>
    13   	<connectionStrings/>
    14   	<system.web>
    15   		<!-- 
    16               Set compilation debug="true" to insert debugging 
    17               symbols into the compiled page. Because this 
    18               affects performance, set this value to true only 
    19               during development.
    20           -->
    21   		<httpRuntime maxRequestLength="1048576" executionTimeout="3600"/>
    22   		<compilation debug="true">
    23   			<assemblies>
    24   				<add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    25   				<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    26   				<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    27   				<add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    28   				<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    29   				<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    30   				<add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
    31   		<!--
    32               The <authentication> section enables configuration 
    33               of the security authentication mode used by 
    34               ASP.NET to identify an incoming user. 
    35           -->
    36   		<authentication mode="Windows"/>
    37   		<!--
    38               The <customErrors> section enables configuration 
    39               of what to do if/when an unhandled error occurs 
    40               during the execution of a request. Specifically, 
    41               it enables developers to configure html error pages 
    42               to be displayed in place of a error stack trace.
    43   
    44           <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
    45               <error statusCode="403" redirect="NoAccess.htm" />
    46               <error statusCode="404" redirect="FileNotFound.htm" />
    47           </customErrors>
    48           -->
    49   		<httpHandlers>
    50   			<remove verb="*" path="*.asmx"/>
    51   			<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    52   			<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    53   			<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
    54   		</httpHandlers>
    55   		<httpModules>
    56   			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    57   			<add name="OperationModule" type="OperationModule"/>
    58   		</httpModules>
    59   	</system.web>
    60   	<system.webServer>
    61   		<validation validateIntegratedModeConfiguration="false"/>
    62   		<modules>
    63   			<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    64   		</modules>
    65   		<handlers>
    66   			<remove name="WebServiceHandlerFactory-Integrated"/>
    67   			<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    68   			<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    69   			<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    70   		</handlers>
    71   	</system.webServer>
    72   </configuration>
    73   
    
      
    Johnson
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-25-2007, 4:28 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello.

    this is an interesting problem. well, your config seems ok since you're asking for the correct file. anyway, you're not the first to say that you're always getting the wrong file. unfortunately, i'm only running vs 2008 and haven't got the vs 2005 on the machine (which means that i can't reproduce this). anyway, what i'd like to know is if you've configured fusion to see why it is loading the wrong version of the file:

    http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx

     

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-25-2007, 5:08 AM
    • Contributor
      2,273 point Contributor
    • Johnson2007
    • Member since 05-17-2007, 7:19 AM
    • Posts 449

    Hi Luis Abreu,

     Thanks. I read the article, but I could not find the [HKLM\Software\Microsoft\Fusion on my server. otherway, the exception seems a assembly loaded by error. The website is developed on a machine which is installed vs2005 and vs2008 beta 2. and the publish environment is only installed framework 2.0.
     

     

    Johnson
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-25-2007, 5:33 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello again.

    so, what you're saying is that the server only has .net 2.0 + asp.net ajax, right? this makes things look even stranger because in your config i didn't see any reference to a 3.5 dll....

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-25-2007, 5:46 AM
    • Contributor
      2,273 point Contributor
    • Johnson2007
    • Member since 05-17-2007, 7:19 AM
    • Posts 449

    Hi Luis Abreu,

    Thank you again. Yes. The server has .net 2.0 and asp.net Ajax. At the very beginning, My development machine also had VS2005 and Ajax, everything is ok. But now our development machine has vs2008 beta 2 installed. Our web project compiles and runs OK on my development machine and after it is published to the server, it raise the exception as mentioned above.

    As I have mentioned, at beginning, I had found the web.config contains the section:<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken...>. So I modified it to <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken...>. But it still did not work. I had to uninstall vs2008 beta 2 from my development machine temporary.

    Thanks. 

    Johnson
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-25-2007, 6:05 AM
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello.

    one question: do you have any projects that depend on the ajax funcionality and that you're using on your web app? for instance, imagine you've created a class library project where you have your own custom extender. in your development machine, you're compiling everything and the custom extender dll is built against the 3.5 version and its put in your bin folder. then, if you're simply copying your project, you might get that expcetion because that custom extender was built agains version 3.5. in other words, the code of the site will work, but since you have a dll that depends on the 3.5 version, you'll get that kind of exception. this it the only thing i'm remembering that might create that kind of problems....

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-25-2007, 9:30 AM
    • Contributor
      2,273 point Contributor
    • Johnson2007
    • Member since 05-17-2007, 7:19 AM
    • Posts 449

    Hi Luis Abreu,

    There is not any class library project using ajax except one of aspx page. In this page I only use a UpdatePanel and AjaxToolkit CalenderExtender control. Today I heart one of my colleagues encounter the same problem.

    Johnson
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-25-2007, 9:36 AM
    Answer
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello again.

    aha, i think that is the problem. i'm almost positive that the toolkit dll you're using was compiled against the 3.5 version of system.web.extensions and not agains the 1.XXX version. it's a similar situation to the one i was mentioning previously but in this case, you're using a 3rd party library. i think that you can easily check this by loading the dll on reflector and seeing its dependencies...

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-25-2007, 10:41 AM
    • Contributor
      2,273 point Contributor
    • Johnson2007
    • Member since 05-17-2007, 7:19 AM
    • Posts 449

    But I do use the AjaxToolkit 1.0 and also toolkit dll is not exists under bin folder.

    I tested again. I create a web site that contains only one Default.aspx page on another computer, which has only VS 2005 and ajax 1.0 installed. I build it and publish it to the same computer. All works fine. Then I intalled vs2008 on the computer. Then I compile the website and publish it. The published website works well. Finally, I uninstall the vs2008 and then try to run the published web site, It raise the exception: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0.... The published web site only contains a empty App_Data folder, Default.aspx, Default.aspx.cs, and web.config files.

    Thank you!

    Johnson
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-25-2007, 3:36 PM
    Answer
    • All-Star
      25,662 point All-Star
    • Luis Abreu
    • Member since 02-12-2005, 6:22 AM
    • Madeira [Portugal]
    • Posts 5,368
    • TrustedFriends-MVPs

    hello again.

    ok, if you can, please pack that sample and send it to my mail address. I think i have a virtual machine at home and i'll try to run it from there.

    --
    Regards,
    Luis Abreu
    email: labreu_at_gmail.com
    EN blog:http://msmvps.com/blogs/luisabreu
  • Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0

    10-25-2007, 11:34 PM
    • Contributor
      2,273 point Contributor
    • Johnson2007
    • Member since 05-17-2007, 7:19 AM
    • Posts 449

     Hi Luis Abreu,

    OK. I have sent you my sample. please have a look. Thanks. 

    Johnson
Page 1 of 2 (28 items) 1 2 Next >