title: Can I stop Asp.Net 4 app inheriting .Net 2 parent app's configSections in Web.Config?
body: <p>I have a domain with default top-level site a .Net 2 app. And lots of virtual directories underneath with different apps. I can't get a .Net 4 virtual directory working. </p>
  
  <p>I have read:</p>
  
  <p><a href="https://stackoverflow.com/questions/3918302/net-4-0-inheriting-net-3-5-web-config">.net 4.0 inheriting .net 3.5 web.config?</a></p>
  
  <p>and I have a similar issue as: <a href="https://stackoverflow.com/questions/367282/disable-web-config-inheritance">Disable web.config inheritance?</a> which has not been solved - the answers to that question that have been given are to use inheritInChildApplications, which can't go around the configSections tags.</p>
  
  <p>I've managed to stop all .Net 2 subapps of the domain from inheriting the top-level 
  web.config settings, but for the .Net 4 app I can't seem to.</p>
  
  <pre><code>&lt;location path="." inheritInChildApplications="false"&gt; 
  </code></pre>
  
  <p>is wrapped around the System.Web section of the parent .Net 2 app, and and I have </p>
  
  <pre><code>&lt;clear/&gt; 
  </code></pre>
  
  <p>in every section in the Web.Config of the .Net 4 virtual directory app.</p>
  
  <p>Is there any other solution? Perhaps the parent .Net 2 app could be placed on a virtual directory, and the top-level site request could be URL ReWritten without the user's knowledge?</p>