2010-07-21 61 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

相关问题