Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I host a .net 2.0 virtual directory in asp.net 4.0 site?

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"/>
like image 436
Merritt Avatar asked Aug 12 '10 16:08

Merritt


1 Answers

Add the following into your root web.config

<location path="." inheritInChildApplications="false"> 
like image 170
Ben Robinson Avatar answered Sep 20 '22 14:09

Ben Robinson