Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How do I work my way around this catch-22? Any suggestions? I've spent a good deal of time Googling for any possible workarounds and some of what I've done is a result of that, but I am still stuck.

See the tags list for this post for my environment. I am testing with IIS7 on Win7 with VS2010 and ASP.NET 4/VB.NET but Classic ASP/VBScript as well.
Basically, I have a main 'mysite.com' and it's a Classic ASP Web Application and at the root.

In a directory '/NAAC/purchase' I have a sub-application using ASP.NET 4/VB.NET developed with VS2010 and using AJAX.

I'm in a bit of a bind. I had to comment out the whole <configSections> element of my web.config (of the root - Classic ASP - website) file in order to get the sites to play nice with each other, but then AJAX stops working because the stuff in the commented out section is necessary for AJAX.

With the stuff commented out, I get "Microsoft JScript runtime error: ASP.NET Ajax client-side framework failed to load." But the index.aspx page of my sub-website loads fine otherwise. Now, let's say I remove the web.config comments and I have:

HTML
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    &lt;!-- Register a new config section--&gt;
    <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>
	proprietary stuff here...
    </appsettings>
    &lt;!-- Connection string, currently configured for SQL Express--&gt;
    <system.web>
        <compilation debug="true" targetframework="4.0">
            <assemblies>
                <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.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.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
            </assemblies>
        </compilation>
        <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" />
            </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" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </httphandlers>
        <httpmodules>
            &lt;!--<remove name="UrlRewriter" />--&gt;
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </httpmodules>
        <identity impersonate="false" />
        <authentication mode="Windows" />
    </system.web>
    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warninglevel="4">
                <provideroption name="CompilerVersion" value="v4.0" />
                <provideroption name="WarnAsError" value="false" />
            </compiler>
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warninglevel="4">
                <provideroption name="CompilerVersion" value="v4.0" />
                <provideroption name="OptionInfer" value="true" />
                <provideroption name="WarnAsError" value="false" />
            </compiler>
        </compilers>
    </system.codedom>
    <system.webserver>
        <validation validateintegratedmodeconfiguration="false" />
        <modules>
            <remove name="ScriptModule" />
            <add name="ScriptModule" precondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated" />
            <remove name="ScriptHandlerFactory" />
            <remove name="ScriptHandlerFactoryAppServices" />
            <remove name="ScriptResource" />
            <add name="PageHandlerFactory-ISAPI-4.0" path="*.aspx" verb="*" modules="IsapiModule" scriptprocessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourcetype="Unspecified" precondition="classicMode,runtimeVersionv4.0,bitness32" />
            <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" verb="GET,HEAD" path="ScriptResource.axd" precondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        </handlers>
    </system.webserver>
    <runtime>
        <assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <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.Design" publickeytoken="31bf3856ad364e35" />
                <bindingredirect oldversion="1.0.0.0-1.1.0.0" newversion="3.5.0.0" />
            </dependentassembly>
        </assemblybinding>
    </runtime>
</configuration>


But now I get "HTTP Error 500.19 - Internal Server Error. The requested page cannot be accessed because the related configuration data for the page is invalid. There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined."

You see, I commented out the <configSections> element in my Web.config in order to work around this error, but then AJAX won't work even though the rest of the page displays.

How do I work my way around this catch-22? I'd be grateful for any suggestions!
Posted
Updated 11-Aug-11 11:49am
v4

1 solution

Try this Fix link dude(Let me know if still any error)
Duplicate Config Section in web.config[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900