IIS6 虚拟目录无法作为应用程序访问

发布于 2024-09-10 21:54:21 字数 1151 浏览 4 评论 0原文

我有一个带有 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.xml 文件。引发异常的 config 似乎是父网站的 .config,而不是虚拟目录中的 web.config。但我不明白为什么。

当访问网站内的常规页面(不在虚拟目录下)时,它们会正常渲染和执行,这表明 IMSControls DLL 无法从虚拟目录加载,但同样,我不明白为什么这会涉及到的过程。

I have a WinSrv2k3 box with IIS6 hosting a series of sites, one of which is a VB/.NET2 site. Inside this I have created a virtual directory and pointed it at a very simple C#/.NET3.5 site's directory. I was expecting the site to allow me to view the pages as a normal site (there is only one ASMX in the virtual directory) but when accessing the page from a browser, I get:

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

The issue I see there, is that the web.config throwing the exception appears to be the parent web site's .config, not the web.config in the virtual directory. But I don't understand why.

When accessing regular pages within the website (not under the virtual directory) they render and perform as normal, indicating that the IMSControls DLL is unable to load from the virtual directory, but again, I don't understand why this would even be involved in the process.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晨敛清荷 2024-09-17 21:54:21

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

基本上,要阻止虚拟目录继承其父站点的 web.config 的属性(以及因此产生的任何问题),父站点的 web.config 需要具有其 元素包裹在一个新的(对我来说)标签中:

<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

Ok, well, after some false starts, heavy googling gave me the correct thing to look for: web.config inheritance.

Basically, to stop a virtual directory from inheriting the attributes of it's parent site's web.config (and therefore any problems from it) the parent site's web.config needs to have its <system.web> element wrapped in a new (to me) tag:

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

Useful links:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文