views:

41

answers:

2

We've had no problems running .NET 4.0 virtual directories in 2.0 web sites, but the opposite way around is giving us some issues. This is understandable, but is there a way to work around this problem? They are running with different application pools... can we have the virtual directory skip the website's web.config and go directly to the machine.config?

We are getting the following error:

Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

Source Error: 

Line 22:   </appSettings>
Line 23:   <system.web>
Line 24:     <compilation debug="true" targetFramework="4.0" />
Line 25:     <customErrors defaultRedirect="url" mode="RemoteOnly">
Line 26:       <error statusCode="404" redirect="~/404.aspx"/>
+1  A: 

Add the following into your root web.config

<location path="." inheritInChildApplications="false"> 
Ben Robinson
+1  A: 

http://stackoverflow.com/questions/783732/is-it-possible-to-completely-negate-a-higher-web-config-in-a-subfolder

In your root web.config:

  <location path="." inheritInChildApplications="false">
    <system.web>      
        <compilation debug="true" targetFramework="4.0" />
    </system.web>
  </location>

(Ben got to this first, but I'll leave this answer as it points to a few alternatives)

ScottE
Thanks for the answer and the notification of duplication.
Merritt
Oh, I'll give him credit then.
Merritt