根目录做了url重写,虚拟目录运行提示“未能加载文件httpmodule或它的某一个依赖项。系统找不到指定的文件”解决方案...

  很多人有时都会为虚拟目录中的web.config继承了主目录中的web.config而苦恼, 大部分主要是由于根目录中的web.config添加了httphandler、 httpmodule 引起的。

  其实这个问题解决起来很简单,只将 httphandler httpmodule的声明添加到location中即可。也就是把<system.web> </system.web> 外加<location></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 指是否被子级应用程序继承

转载于:https://www.cnblogs.com/liyongfisher/archive/2010/05/24/1742819.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值