Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.[Answered]RSS
I get this lovely error whenever I attempt to load an AJAXToolKit ScriptManager. It is the only one I have on the page. If I use the regulare script manager, my extenders don't detect it. I'm placing the ScriptManager just after the <Form> tag.
The frustrating part is that it works when I preview it in the browser from my development machine it works, but once I place it the live server, it crashes on me [*-)].
I've installed all of the .dlls in the proper places.
Also, I'm trying to attempt to do this when creating a new site with the AJAX ToolKit enabled template, still to no avail.
Your problem seems that it is mainly caused by the System Enviroments. Ajax-enabled program runs depend on .Net Framework2.0 or above.(If your application developed based on .NET Framework 3.5, please make sure it should be runs on .Net Framework 3.5) Sometimes
, the newly created ajax application runs on .Net Framework 1.1(IIS). So please check it first. Second, you should check whether Asp.Net 2.0 Ajax Extensions V1.0 has been installed or not.
Best regards,
Jonathan
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
Instead of starting another thread...I have the exact same error
There is no source involved.
Create a ASP.Net (3.5) page in VS08beta,
place a ToolScriptManager on the form with a TetBox and a CalendarExtendar targeting the TextBox and the 'View in Browser' and it will give you
Thoughts?
Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Please change the web.config settings, I suspect your web.config is based on the .NET Framework 2.0. Here is the sample.
<!--
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>
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Commented out to avoid "The current trust level does not allow use of the 'compilerOptions' attribute"
<trust level="Medium"/>
-->
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<!--<add assembly="System.Data.DataSetExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>-->
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</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>
-->
<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/warnaserror-" warningLevel="4"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" compilerOptions="/optioninfer+"
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
</compiler>
</compilers>
</system.codedom>
<system.web.extensions>
<scripting>
<webServices>
<!--
Uncomment this section to enable the authentication service. Include
requireSSL="true" if appropriate.
<authenticationService enabled="true" requireSSL = "true|false"/>
-->
<!--
Uncomment these lines to enable the profile service, and to choose the
profile properties that can be retrieved and modified in ASP.NET AJAX
applications.
<profileService enabled="true"
readAccessProperties="propertyname1,propertyname2"
writeAccessProperties="propertyname1,propertyname2" />
-->
<!--
Uncomment this section to enable the role service.
<roleService enabled="true"/>
-->
</webServices>
<!--
<scriptResourceHandler enableCompression="true" enableCaching="true" />
-->
</scripting>
</system.web.extensions>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<directoryBrowse enabled="true"/>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.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=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.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=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
</system.webServer>
</configuration>
I hope this help.
Best regards,
Jonathan
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
Thanks Jonathan - Made the changes you suggested, actually I just copied and pasted yours. Results below
Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Please make sure that your application runs on .NET Framework 3.5 and your
Ajax Control Toolkit's version is compatible with the Framework. The web.config file that I posted is based on Ajax Control Toolkit V10920. Also, you should pay attention to the settings that you added to the web.config for your needs.
Best regards,
Jonathan
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
Jonathan - followed link, grabbed the suggested files, installed and created new tab with the 10109 version of the AJAX components.
Maybe we should start from the top.
From what I've seen in the MS training videos online (for example) the AJAX calander control is dragged onto the screen, targeted to a text box and "View in browser" ... done, works. So I tried same by following along
Here're the exact step I've taken
Open VS2008beta
Select .Net framework 3.5 from the dropdown
create new website
open the aspx page
drag a ToolkitScriptManager (v. 1010920) onto the page
drag a textbox onto the page
drag an a calender control (v. 1010920) onto the page and set its Target to TextBox1
do nothing else, build the page, then view in browser....error (above)
I am very new to AJAX in ASP.Net (coming from .Net 1.1) so maybe there are some other things (configuration? installations?) I am not aware of. Any hints or shoves in the right direction are appreciated.
Please recompile the Ajax Control Toolkit source code and run its CalendarExtender Sample to see whether it works properly or not. If it works, we can come to a conclusion that your enviroments are ok. So we can copy the sample website's web.config to your
newly created website and refrence the AjaxControlToolkit V10920. AjaxControlToolkit V10920 has two versions. One is for .Net Framework2.0 and another is for .NET Framework3.5. So please make sure you are using the right version which should work on .NET
Framework3.5.
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
"Please recompile the Ajax Control Toolkit source code and run its CalendarExtender Sample to see whether it works properly or not.
" - Did, and does when I run the sample site, all works
"If it works, we can come to a conclusion that your enviroments are ok." - Agree
"So we can copy the sample website's web.config to your newly created website... " - Did, same results below as above...
"...and refrence the AjaxControlToolkit V10920. AjaxControlToolkit V10920 has two versions. One is for .Net Framework2.0 and another is for .NET Framework3.5. So please make sure you are using the right version which should work on .NET Framework3.5."
- And now you've lost me...how can I tell the diff? If I download the 'AjaxControlToolkit-Framework3.5' do I need to repoint or create a new AJAX toolbar in my dev env? Do I need an AjaxTollbar2.0 and a AjaxToolBar3.5?
Results...
Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
"Please recompile the Ajax Control Toolkit source code and run its CalendarExtender Sample to see whether it works properly or not.
" - Did, and does when I run the sample site, all works
"If it works, we can come to a conclusion that your enviroments are ok." - Agree
"So we can copy the sample website's web.config to your newly created website... " - Did, same results below as above...
"...and refrence the AjaxControlToolkit V10920. AjaxControlToolkit V10920 has two versions. One is for .Net Framework2.0 and another is for .NET Framework3.5. So please make sure you are using the right version which should work on .NET Framework3.5."
- And now you've lost me...how can I tell the diff? If I download the 'AjaxControlToolkit-Framework3.5' do I need to repoint or create a new AJAX toolbar in my dev env? Do I need an AjaxTollbar2.0 and a AjaxToolBar3.5?
Results...
Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Hey MCP,
I had to add an assembly binding redirect. I added it just before the closing configuration element.
If I download the 'AjaxControlToolkit-Framework3.5' do I need to repoint or create a new AJAX toolbar in my dev env? Do I need an AjaxTollbar2.0 and a AjaxToolBar3.5?
Actually, it is based on the .NET Framework version that you use on your project. When use different AjaxControlToolkit, please recreate the Toolbox. Hope this help.
Best regards,
Jonathan
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
Looks like grabbing the 10920 version did the trick. I won't tell you whatelse I did that may or may not have helped (uninstall, reload) but appears to be behaving as described by M$.
I also had this error when deploying to a web server, although it worked fine when debugged from within VS 2008. In the end I found that I had duplicate dependentAssembly tags in the web.config:
I actually have the same problem and I know I already have System Web Extensions 1.0.61025 already installed in the SP instance and working with other web parts targeting ASP.Net 2.0. This new web part project is targeting ASP .Net 3.5 and is attempting to
use System.Web.Extensions 3.5. So the question is can they work together? Does the previious posts dependentAssembly mean that I can with this entry? If so where does it go?
Sorry Thanks my guess was the solution - just don't try putting web parts created using the ASP.Net 2.0 Extensions on the same page with ASP .Net 3.5 Ajax Extensions.... Strange things happen if you do
None
0 Points
16 Posts
Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to...
Oct 18, 2007 07:32 AM|AntLaC|LINK
Hello,
I get this lovely error whenever I attempt to load an AJAXToolKit ScriptManager. It is the only one I have on the page. If I use the regulare script manager, my extenders don't detect it. I'm placing the ScriptManager just after the <Form> tag.
The frustrating part is that it works when I preview it in the browser from my development machine it works, but once I place it the live server, it crashes on me [*-)].
I've installed all of the .dlls in the proper places.
Also, I'm trying to attempt to do this when creating a new site with the AJAX ToolKit enabled template, still to no avail.
All-Star
24409 Points
3416 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Oct 23, 2007 07:55 AM|Jonathan Shen – MSFT|LINK
Hi Antlac,
Your problem seems that it is mainly caused by the System Enviroments. Ajax-enabled program runs depend on .Net Framework2.0 or above.(If your application developed based on .NET Framework 3.5, please make sure it should be runs on .Net Framework 3.5) Sometimes , the newly created ajax application runs on .Net Framework 1.1(IIS). So please check it first. Second, you should check whether Asp.Net 2.0 Ajax Extensions V1.0 has been installed or not.
Best regards,
Jonathan
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
None
0 Points
11 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Oct 23, 2007 03:23 PM|mastercontrolprogram|LINK
Instead of starting another thread...I have the exact same error
There is no source involved.
Create a ASP.Net (3.5) page in VS08beta,
place a ToolScriptManager on the form with a TetBox and a CalendarExtendar targeting the TextBox and the 'View in Browser' and it will give you
Thoughts?
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
All-Star
24409 Points
3416 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Oct 23, 2007 10:38 PM|Jonathan Shen – MSFT|LINK
Hi MasterControlProgram,
Please change the web.config settings, I suspect your web.config is based on the .NET Framework 2.0. Here is the sample.
I hope this help.
Best regards,
Jonathan
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
None
0 Points
11 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Oct 24, 2007 10:29 AM|mastercontrolprogram|LINK
Thanks Jonathan - Made the changes you suggested, actually I just copied and pasted yours. Results below
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
All-Star
24409 Points
3416 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Oct 24, 2007 09:51 PM|Jonathan Shen – MSFT|LINK
Hi MasterControlProgram,
Please make sure that your application runs on .NET Framework 3.5 and your Ajax Control Toolkit's version is compatible with the Framework. The web.config file that I posted is based on Ajax Control Toolkit V10920. Also, you should pay attention to the settings that you added to the web.config for your needs.
Best regards,
Jonathan
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
None
0 Points
11 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Oct 25, 2007 03:11 PM|mastercontrolprogram|LINK
Jonathan - followed link, grabbed the suggested files, installed and created new tab with the 10109 version of the AJAX components.
Maybe we should start from the top.
From what I've seen in the MS training videos online (for example) the AJAX calander control is dragged onto the screen, targeted to a text box and "View in browser" ... done, works. So I tried same by following along
Here're the exact step I've taken
Open VS2008beta
Select .Net framework 3.5 from the dropdown
create new website
open the aspx page
drag a ToolkitScriptManager (v. 1010920) onto the page
drag a textbox onto the page
drag an a calender control (v. 1010920) onto the page and set its Target to TextBox1
do nothing else, build the page, then view in browser....error (above)
I am very new to AJAX in ASP.Net (coming from .Net 1.1) so maybe there are some other things (configuration? installations?) I am not aware of. Any hints or shoves in the right direction are appreciated.
Thanks!
MCP
All-Star
24409 Points
3416 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Oct 25, 2007 11:39 PM|Jonathan Shen – MSFT|LINK
Hi MCP,
It is such a weird issue. I have tested on my local machine with VS2008 + Ajax Control Toolkit V10920 and it works pretty fine. Here is the sample.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</ajaxToolkit:ToolkitScriptManager>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1">
</ajaxToolkit:CalendarExtender>
</form>
</body>
</html>
Please recompile the Ajax Control Toolkit source code and run its CalendarExtender Sample to see whether it works properly or not. If it works, we can come to a conclusion that your enviroments are ok. So we can copy the sample website's web.config to your newly created website and refrence the AjaxControlToolkit V10920. AjaxControlToolkit V10920 has two versions. One is for .Net Framework2.0 and another is for .NET Framework3.5. So please make sure you are using the right version which should work on .NET Framework3.5.
Here is another useful hint.
I hope this help.
Best regards,
Jonathan
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
None
0 Points
11 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Oct 26, 2007 01:37 PM|mastercontrolprogram|LINK
"Please recompile the Ajax Control Toolkit source code and run its CalendarExtender Sample to see whether it works properly or not. " - Did, and does when I run the sample site, all works
"If it works, we can come to a conclusion that your enviroments are ok." - Agree
"So we can copy the sample website's web.config to your newly created website... " - Did, same results below as above...
"...and refrence the AjaxControlToolkit V10920. AjaxControlToolkit V10920 has two versions. One is for .Net Framework2.0 and another is for .NET Framework3.5. So please make sure you are using the right version which should work on .NET Framework3.5." - And now you've lost me...how can I tell the diff? If I download the 'AjaxControlToolkit-Framework3.5' do I need to repoint or create a new AJAX toolbar in my dev env? Do I need an AjaxTollbar2.0 and a AjaxToolBar3.5?
Results...
Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection'.
None
0 Points
16 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Oct 26, 2007 04:52 PM|AntLaC|LINK
Hey MCP,
I had to add an assembly binding redirect. I added it just before the closing configuration element.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="3.5.0.0" newVersion="1.0.61025.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Now though, it doesn't work in VS2008, but it does in the live server. So, I have 2 versions of the web.config.
Hopefully this will work for you.
Please mark this as answer if it worked. [8-|]
All-Star
24409 Points
3416 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Oct 28, 2007 10:03 PM|Jonathan Shen – MSFT|LINK
Hi MCP,
Actually, it is based on the .NET Framework version that you use on your project. When use different AjaxControlToolkit, please recreate the Toolbox. Hope this help.
Best regards,
Jonathan
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
None
0 Points
11 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Oct 29, 2007 01:45 PM|mastercontrolprogram|LINK
Looks like grabbing the 10920 version did the trick. I won't tell you whatelse I did that may or may not have helped (uninstall, reload) but appears to be behaving as described by M$.
Thanks!
Member
13 Points
42 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Aug 26, 2008 11:44 PM|chambem9|LINK
I also had this error when deploying to a web server, although it worked fine when debugged from within VS 2008. In the end I found that I had duplicate dependentAssembly tags in the web.config:
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
Removing one of them fixed the error.
None
0 Points
2 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Jan 23, 2009 08:07 PM|sschaff|LINK
None
0 Points
2 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Jan 24, 2009 10:39 PM|sschaff|LINK
Sorry Thanks my guess was the solution - just don't try putting web parts created using the ASP.Net 2.0 Extensions on the same page with ASP .Net 3.5 Ajax Extensions.... Strange things happen if you do
None
0 Points
6 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Nov 20, 2009 09:56 AM|Hasu|LINK
Thanks AntLac, It works
i pasted the same code given by you here it is
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"><runtime></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> <dependentAssembly></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> <bindingRedirect oldVersion="3.5.0.0" newVersion="1.0.61025.0"/></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> </dependentAssembly></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> </assemblyBinding></div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> </runtime></div><runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="3.5.0.0" newVersion="1.0.61025.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
None
0 Points
1 Post
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Jan 15, 2010 10:09 PM|peterjp80|LINK
Jonathan, thanks for posting this. It was a great help.
None
0 Points
6 Posts
Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to...
Mar 06, 2010 03:04 PM|imanabidi|LINK
for me removing
xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"
from the <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
solved the problem.
Member
2 Points
12 Posts
Re: Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection...
Feb 16, 2011 01:29 AM|amit_bhagat|LINK
I converted my webproject from Framework .Net2.0 to .Net 3.5 where I was facing the same error
Unable to cast object of type 'System.Web.Configuration.ScriptingScriptResourceHandlerSection' to..."..
I removed
xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" from <configuration> section of webconfig & it's working for me
Thanks .....
Amit