1

I've looked at the related questions and followed their solutions, but it's still isn't working for me. Any help is appreciated, thank you.

I have a web application added as a virtual directory (under the parent site) and converted into an application. It even has its own application pool. The parent is .net 2.0 and child is .net 4.0.

The parent's Web.Config:

<configuration>
    <configSections>
        <sectionGroup name="system.web.extensions" ...>
            <sectionGroup name="scripting" ...>
                <section name="scriptResourceHandler" ... />
                <sectionGroup name="webServices" ...>
                    <section name="jsonSerialization" ... />
                    <section name="profileService" ... />
                    <section name="authenticationService" ... />
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>
    </configSections>
    ...
</configuration>

Child's Web.Config

<configurations>
    <configSections>
            <clear/>      
    </configSections>
    <connectionStrings>
        ...
    </connectionStrings>
</configuration>

My error message:

There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined

The <clear/> doesn't work. I've also tried referencing the system.web.extensions block outside of <configSections>, and wrapping it in

<location path="." inheritInChildApplications="false">

and it still doesn't work.

I've also tried removing those sections in the child's Web.Config and it still doesn't work:

<configurations>
    <configSections>
            <remove name="system.web.extensions" />     
    </configSections>
    <connectionStrings>
        ...
    </connectionStrings>
</configuration>

At this point, I don't know what else to try. Is there a way to separate the child web application completely from the parent, but still retaining the parent's domain? I.E. I want to be able to access the child's website through www.parent.com/child.

Thanks again.

dam
  • 171
  • 1
  • 6
  • 17
  • Duplicate: http://stackoverflow.com/questions/782252/avoid-web-config-inheritance-in-child-web-application-using-inheritinchildapplic – ScottE Jun 03 '15 at 00:50
  • @ScottE I tried to employ the solutions listed on that thread but it wouldn't solve my problems. If you read my question, I mentioned wrapping the sections with . – dam Jun 03 '15 at 01:07
  • 1
    Microsoft has enough documentation on how to run ASP.NET 2 and 4 side by side. You just need to check the official guide by a search engine. – Lex Li Jun 03 '15 at 02:27
  • Thanks, @LexLi. Your answer led me to this page: http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc245724860. It helped me move the into the root web.config (C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG). After that, I wrapped each sections in the parent's web.config with and it seems to be working now. – dam Jun 03 '15 at 19:16

1 Answers1

0

This link helped me: http://www.asp.net/whitepapers/aspnet4/breaking-changes#0.1__Toc245724860

I moved the into the root web.config (C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG). After that, I wrapped each sections in the parent's web.config with

<location path="." inheritInChildApplications="false">

and it seems to be working now.

dam
  • 171
  • 1
  • 6
  • 17