我可以托管在asp.net 4.0网站的一个.NET 2.0的虚拟目录? [英] Can I host a .net 2.0 virtual directory in asp.net 4.0 site?

查看:170
本文介绍了我可以托管在asp.net 4.0网站的一个.NET 2.0的虚拟目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经有运行2.0网站.NET 4.0的虚拟目录没有问题,但各地以相反的方式给我们提供了一些问题。这是可以理解的,但有没有办法来解决这个问题呢?他们与不同的应用程序池中......可我们有虚拟目录跳过网站的web.config,并直接进入的machine.config?

我们越来越以下错误:

 分析器错误信息:无法识别的属性targetFramework。需要注意的是属性名称是区分大小写的。

源错误:

第22行:LT; /的appSettings>
第23行:LT;的System.Web>
第24行:LT;编译调试=真正的targetFramework =4.0/>
第25行:LT;的customErrors的defaultRedirect =URL模式=仅限远程>
第26行:其中,错误状态code =404重定向=〜/ 404.aspx/>
 

解决方案

添加以下到您的根web.config

 <位置路径=。 inheritInChildApplications =假>
 

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"/>

解决方案

Add the following into your root web.config

<location path="." inheritInChildApplications="false"> 

这篇关于我可以托管在asp.net 4.0网站的一个.NET 2.0的虚拟目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆