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.
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.
Thank all of you for your replay. Here is the content of my web.config file. Thanks.
1 <?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings>
</appSettings>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<httpRuntime maxRequestLength="1048576" executionTimeout="3600"/>
<compilation debug="true">
<assemblies>
<add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<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"/>
<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"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="OperationModule" type="OperationModule"/>
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<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"/>
<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"/>
<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"/>
</handlers>
</system.webServer>
</configuration>
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:
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.
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
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.
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
Johnson2007
Contributor
2273 Points
449 Posts
Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0
Oct 23, 2007 05:40 AM|LINK
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.
jimmy q
All-Star
54108 Points
3578 Posts
Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0
Oct 23, 2007 07:45 AM|LINK
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.
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0
Oct 23, 2007 09:24 AM|LINK
hello.
yes, a redirect will solve it for you...
Regards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
gt1329a
All-Star
15377 Points
2501 Posts
ASPInsiders
MVP
Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0
Oct 23, 2007 05:04 PM|LINK
Post your entire web.config (minus any connection strings), if you don't mind.
A guide to combining jQuery and ASP.NET: jQuery for the ASP.NET developer
Johnson2007
Contributor
2273 Points
449 Posts
Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0
Oct 25, 2007 07:27 AM|LINK
Hi all,
Thank all of you for your replay. Here is the content of my web.config file. Thanks.
1 <?xml version="1.0"?> <!-- Note: As an alternative to hand editing this file you can use the web admin tool to configure settings for your application. Use the Website->Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in \Windows\Microsoft.Net\Framework\v2.x\Config --> <configuration> <appSettings> </appSettings> <connectionStrings/> <system.web> <!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development. --> <httpRuntime maxRequestLength="1048576" executionTimeout="3600"/> <compilation debug="true"> <assemblies> <add assembly="System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Drawing.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation> <!-- The <authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> <authentication mode="Windows"/> <!-- The <customErrors> section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <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"/> <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"/> </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add name="OperationModule" type="OperationModule"/> </httpModules> </system.web> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </modules> <handlers> <remove name="WebServiceHandlerFactory-Integrated"/> <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"/> <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"/> <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"/> </handlers> </system.webServer> </configuration>Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0
Oct 25, 2007 08:28 AM|LINK
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.aspxRegards,
Luis Abreu
email: labreu_at_gmail.com
EN blog:http://msmvps.com/blogs/luisabreu
Johnson2007
Contributor
2273 Points
449 Posts
Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0
Oct 25, 2007 09:08 AM|LINK
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.
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0
Oct 25, 2007 09:33 AM|LINK
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
Johnson2007
Contributor
2273 Points
449 Posts
Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0
Oct 25, 2007 09:46 AM|LINK
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.
Luis Abreu
All-Star
25674 Points
5369 Posts
MVP
Re: Could not load file or assembly 'System.Web.Extensions, Version=3.5.0.0
Oct 25, 2007 10:05 AM|LINK
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