禁用的web.config继承? [英] Disable web.config inheritance?

查看:261
本文介绍了禁用的web.config继承?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站根目录下的内容管理应用程序,和我想要的子文件夹下使用不同的应用程序(如计费应用)。不幸的是,根站点的web.config中被干扰与子应用程序。

I have a content management application in the root of my website, and I'm trying to use a different app (a billing application) under a sub-folder. Unfortunately, the web.config of the root site is interfering with the sub-app.

有没有办法只是禁用的web.config继承的子文件夹?

Is there a way to just disable web.config inheritance for a sub-folder?

更新:
正如斯蒂芬·伯里斯链接,使用<地点> 标签可以prevent继承web配置的一部分,具体如下:

Update: As linked by Stephen Burris, using the <location> tag can prevent inheritance for part of the web config, as follows:

<?xml version="1.0"?>
<configuration>
<configSections>
	....
</configSections>
<location path="." inheritInChildApplications="false">
	<appSettings>
		....
	</appSettings>
	<connectionStrings/>
	<system.web>
		....
	</system.web>
	<system.codedom>
		....
	</system.codedom>
	<system.webServer>
		....
	</system.webServer>
</location>
<runtime>
	....
</runtime>
</configuration>

&LT; configSections&GT; &LT;运行&GT; 部分将不接受被封闭在标签.. 。所以我想这不仅会大部分的工作。任何人都知道该怎么做更好?

The <configSections> and <runtime> sections will not accept being enclosed in the tag...so I guess this only does most of the job. Anybody know how to do it better?

推荐答案

有就是你可以在根web.config文件中使用属性导致其不具有其内容成为孩子继承应用程序

There is an attribute that you can use in the root web.config file to cause it not to have its contents become inherited by child applications.

inheritInChildApplications

inheritInChildApplications

博客关于inheritInChildApplications

MSDN文章文件Hierarcy和继承

这篇关于禁用的web.config继承?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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