久久国产精品亚洲艾草网_黄色视频在线免费观看_国产强伦姧在线观看_无码国产69精品久久久久网站

[ASP.NET]在二級(jí)目錄中禁止web.config繼承IIS根目錄的web.config的配置

廣告:

環(huán)境:asp.net mvc2.0 asp.net 3.5 sp1

在我們的ASPNET二級(jí)目錄應(yīng)用中,有時(shí)會(huì)出現(xiàn)一些異常,比如在根目錄的web.config中添加了HttpHandler以及HttpModule(如一些UrlRewiter重寫組件、自己的全局HttpModule等)在二級(jí)目錄運(yùn)行時(shí)就會(huì)提示找不到找不到指定的文件的異常。

解決方法是在根目錄的web.config中針對根路徑通過location配置這些module和handler等, 并且在location設(shè)置允許子目錄重寫,以及是否被子集應(yīng)用程序繼承設(shè)置為false,如下把<system.web> </system.web>包含在<location></location>結(jié)點(diǎn)內(nèi)部:

<configuration>

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

<system.web>

<httpModules>

<add name="UrlRewriteModule"

type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />

</httpModules>

</system.web>

</location>

</configuration>

這樣配置后就不會(huì)影響到我們的子集應(yīng)用程序了,即二級(jí)目錄等

廣告:

編輯:Admin 時(shí)間:2013/10/15 9:04:52 閱覽:2627   返回    
web.config
二級(jí)目錄
掃描關(guān)注53BK報(bào)刊官網(wǎng)
掃描關(guān)注閱速公司微信