2010-07-21 59 views
1

訪問我有IIS6舉辦一系列網站,其中之一是一個VB/.NET2網站WinSrv2k3框。在這裏我創建了一個虛擬目錄,並將其指向一個非常簡單的C#/。NET3.5站點的目錄。我期待的網站,讓我查看的頁面作爲一個正常的網站(只有一個虛擬目錄ASMX),但是從瀏覽器訪問該頁面時,我得到:IIS6虛擬目錄不是一個應用程序

Server Error in '/TestVbSite' Application. 

Configuration Error 

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Could not load file or assembly 'IMSControls' or one of its dependencies. The system cannot find the file specified. (D:\sites\TestVbSite\web.config line 211) 

Source Error: 


Line 209: </httpHandlers> 
Line 210: <httpModules> 
Line 211:  <add name="UrlRewritingModule" type="IMS.Controls.HttpModules.UrlRewritingModule, IMSControls" /> 
Line 212: </httpModules> 
Line 213: </system.web> 

Source File: D:\sites\TestVbSite\web.config Line: 211 

我看到的問題在那裏,是拋出異常的web.config似乎是父網站的.config,而不是虛擬目錄中的web.config。但我不明白爲什麼。

當訪問網站內的常規頁面(不在虛擬目錄下)時,它們呈現並正常執行,表明IMSControls DLL無法從虛擬目錄加載,但我不明白爲什麼會這樣做甚至參與這個過程。

回答

0

好了,好了,一些錯誤的開始之後,沉重的谷歌搜索給了我尋找正確的事情:web.config中繼承。

基本上,要阻止虛擬目錄繼承其父網站的web.config(因此存在任何問題)的屬性,父網站的web.config需要將其<system.web>元素包裹在一個新的(對我來說)標籤:

<location path="." inheritInChildApplications="false"> 
    <system.web> 
    ... 
    </system.web> 
</location> 

相關鏈接:

http://forums.asp.net/t/1164283.aspx

http://dotnetslackers.com/Security/re-55457_Stopping_ASP_NET_web_config_inheritance.aspx

http://msdn.microsoft.com/en-us/library/ms178685.aspx

相關問題