web.config:Root和虚拟目录中Web.Config问题的解决方案

很多人有时都会为虚拟目录中web.config继承了主目录中web.config而苦恼
大部分主要是由于根目录中web.config添加了httphandler、 httpmodule 引起
其实这个问题解决起来很简单只将 httphandler httpmodule声明添加到location中即可
如下所示:

<configuration>
<location path="." allowOverride="true" inheritInChildApplications="false">
<system.web>
<httpModules>
<add name="UrlRewriteModule"
type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
</httpModules>
</system.web>
</location>
</configuration>


path 不用说指定个目录
allowOverride 指是否可以将这个重写
inheritInChildApplications 指是否被子级应用继承

我遇到问题是主目录中引用了DevExpressControl控件结果在WebService中任何页面都提示

未能加载文件或集“DevExpress.Web.ASPxGridView.v8.1, Version=8.1.1.0, Culture=neutral, PublicKeyToken=e0b364db0ebed33f”或它个依赖项系统找不到指定文件

按如上处理思路方法解决了这个问题!
Tags:  web.config加密 web.config配置 webconfig web.config

延伸阅读

最新评论

发表评论