[转]asp.net中虚拟目录不继承主目录的web.config设置
2010-11-04 17:30
323 查看
很多人有时都会为虚拟目录中的web.config继承了主目录中的web.config而苦恼,大部分主要是由于根目录中的web.config添加了httphandler、 httpmodule 引起的。
解决:只将 httphandler httpmodule的声明添加到location中即可。如下所示:
<configuration>
<location path="." inheritInChildApplications="false">
<system.web>
<httpModules>
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
</httpModules>
</system.web>
</location>
</configuration>
path 不用说指定的是一个目录,inheritInChildApplications 指是否被子级应用程序继承
找到程序目录下的web.config,先备份,在<system.web></system.web>两加加上对应的配置,例如<location path="." inheritInChildApplications="false"><system.web>.......</system.web></location>
解决:只将 httphandler httpmodule的声明添加到location中即可。如下所示:
<configuration>
<location path="." inheritInChildApplications="false">
<system.web>
<httpModules>
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
</httpModules>
</system.web>
</location>
</configuration>
path 不用说指定的是一个目录,inheritInChildApplications 指是否被子级应用程序继承
找到程序目录下的web.config,先备份,在<system.web></system.web>两加加上对应的配置,例如<location path="." inheritInChildApplications="false"><system.web>.......</system.web></location>
相关文章推荐
- IIS中ASP.NET虚拟目录不继承主站点web.config设置的办法(转载)
- ASP.NET 虚拟目录继承根Web.Config的问题解决
- asp.net 如何让虚拟目录里面的webconfig不继承主目录config(转)
- asp.net 如何让虚拟目录里面的webconfig不继承主目录config
- [ASP.NET]在虚拟目录中禁止web.config继承IIS根目录的web.config的配置
- [ASP.NET]在虚拟目录中禁止web.config继承IIS根目录的web.config的配置
- 如何让虚拟目录里面的webconfig不继承网站的设置
- 如何让虚拟目录里面的webconfig不继承网站的设置
- 【转】如何让虚拟目录里面的webconfig不继承网站的设置
- 如何让虚拟目录里面的webconfig不继承网站的设置
- 如何让虚拟目录里面的webconfig不继承网站的设置
- 如何让虚拟目录里面的webconfig不继承网站的设置(转)
- 虚拟目录里面的webconfig不继承网站的设置
- 如何让虚拟目录里面的webconfig不继承网站的设置
- 如何让虚拟目录里面的webconfig不继承网站的设置
- IIS配置 如何让虚拟目录里面的webconfig不继承网站的设置
- 如何让虚拟目录里面的webconfig不继承网站的设置
- 如何让虚拟目录里面的webconfig不继承网站的设置
- ASP.NET应用FCKeditor时webconfig的详细设置
- IIS下虚拟目录或应用程序不继承根web.config的解决方法