【问题标题】:IIS6 Virtual Directory not accessible as an appIIS6 虚拟目录无法作为应用程序访问
【发布时间】:2011-03-18 20:27:57
【问题描述】:

我有一个带有 IIS6 的 WinSrv2k3 盒子,它承载了一系列站点,其中一个是 VB/.NET2 站点。在其中,我创建了一个虚拟目录并将其指向一个非常简单的 C#/.NET3.5 站点目录。我希望该站点允许我将页面视为普通站点(虚拟目录中只有一个 ASMX),但是从浏览器访问该页面时,我得到:

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 无法从虚拟目录加载,但我还是不明白为什么会这样参与这个过程。

【问题讨论】:

    标签: iis-6 virtual-directory server-error


    【解决方案1】:

    好的,好吧,在一些错误的开始之后,大量的谷歌搜索让我找到了正确的东西:web.config 继承。

    基本上,要阻止虚拟目录继承其父站点的 web.config 的属性(以及由此带来的任何问题),父站点的 web.config 需要将其 &lt;system.web&gt; 元素包装在一个新的(对我来说) 标签:

    <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

    【讨论】:

      猜你喜欢
      • 2013-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多