I am setting up a new website on new web servers that are running IIS 7.5, which is new to me. I have ran into a problem when deploying an ASP.NET app that is using the 4.0 framework. I get error messages about conflicts with the web.config file associated with the Default Web Site. The asp.net app defined in the default website is using the 2.0 framework currently.
My 4.0 framework app is defined as an application under the default website. Both are usin开发者_StackOverflow社区g different Application Pools.
I tried adding this to my 4.0 apps config file, but it did not seem to help:
<location path="." inheritInChildApplications="false">
How do I get around this web.config conflict issue?
Update for error message:
There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined.
The config file for the 4.0 app does not even have this section. The default website app does have this.
Looks like this is a documented problem, with a solution.
Essentially, you will be moving the configSections information out of the parent 2.0 application's web.config, and instead putting it into a shared 2.0 specific parent web.config (found in C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG and/or C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG), and then using the location tag to hide the rest of your configuration.
Have you tried putting the location tag around the system.web section of the default web application? It sounds like that is what you want to prevent inheritance on, not the 4.0 app (if I understand you right, the 4.0 app is the "child" app of the 2.0 default app).
精彩评论