您的位置:首页 > 其它

IIS中不让下级虚拟目录继承本级的web.config配置

2010-03-01 16:35 218 查看
日前遇到一个问题:在默认网站下建立虚拟网站时,虚拟站报web.config
的配置错误。检查发现是默认网站的配置,而非虚拟站的。虚拟站下没有相关的引用,所以报错。

解决方法有二:

1. 把相关的引用也加入到虚拟站中。

2. 配置默认网站的web.config为不向下继承。

把除了configSecton之外的东西都放到

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

</location>

里面去

如 :

<?xml version="1.0" encoding="UTF-8"?>

<configuration
xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<configSections>

...

</configSections>

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

Put your configuration code here.........

</location>

</configuration>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐