本文介绍了< system.web>之间的区别和< system.webServer&gt ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我都必须为带有IIS7的ASP.NET添加处理程序或模块时,说明总是告诉我将其合并为两个部分:system.websystem.webserver.

Every time I have to add a handler or module for ASP.NET with IIS7, the instructions always tell me to incorporate it into two sections: system.web and system.webserver.

<system.web>
    <httpHandlers>
    </httpHandlers>
    <httpModules>
    </httpModules>
</system.web>

这:

<system.webServer>
    <modules>
    </modules>
    <handlers>
    </handlers>
</system.webServer>

这两个部分有什么区别?

What is the difference between these two sections?

此外,如果我没有将其添加到system.web部分,则我的Visual Studio 2008调试器也将无法正常工作.

In addition, if I don't add it to the system.web section, my Visual Studio 2008 debugger also doesn't work correctly.

推荐答案

system.web部分用于配置IIS 6.0,而system.webserver版本用于配置IIS 7.0. IIS 7.0包括一个新的ASP.NET管道和一些配置差异,因此包括额外的配置部分.

The system.web section is for configuring IIS 6.0, while the system.webserver version is used to configure IIS 7.0. IIS 7.0 includes a new ASP.NET pipeline and some configuration differences, hence the extra config sections.

但是...

如果仅在集成模式下运行IIS 7.0,则无需将处理程序添加到两个部分中.除非我误会,否则将其添加到system.web也是在经典模式下运行的IIS 7.0的后备.我尚未对此进行广泛的测试.

If you're running IIS 7.0 in integrated mode only, you shouldn't need to add the handlers to both sections. Adding it to system.web as well is a fallback for IIS 7.0 operating in classic mode, unless I'm mistaken. I've not done extensive testing on this.

请参见 http://msdn.microsoft.com/en-us/library/bb763179.aspx 了解更多信息.

这篇关于&lt; system.web&gt;之间的区别和&lt; system.webServer&gt ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 01:29