title: Unrecognized attribute 'targetFramework'. in 4.0 Site with 2.0 sub folder?
body: <p>I have recently upgraded a site to .net 4.0. I changed the app pool and almost everything is working properly.</p>
  
  <p>However the admin section of the site which is in an 'admin' subfolder with its own web.config is still running under 2.0 for some reason. When I left click the sub directory in IIS and check the ASP.net tab of properties it get ASP.NET version 2.0.50727.</p>
  
  <p>If i click 'Edit Configuration' I get this error
  "An error has occured attemping to read the configuration." The error message is:</p>
  
  <p>Unrecognized attribute 'targetFramework'. Note the attribute names are case-sensitive.</p>
  
  <p>The web config in the protected directly looks like this</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!-- 
      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-&gt;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 
  --&gt;
  &lt;configuration&gt;
      &lt;appSettings/&gt;
      &lt;connectionStrings/&gt;
      &lt;system.web&gt;
          &lt;authorization&gt;
              &lt;deny users="?"/&gt;
          &lt;/authorization&gt;
          &lt;customErrors mode="Off"&gt;&lt;/customErrors&gt;
      &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>When I try to navigate to the admin section i get "Server Application Unavailable" and an entry in the app log complaining about two different versions.</p>
  
  <p>Everything is running under the same app pool which is 4.0. Why is the sub folder not 4.0 and how do I fix it?</p>