简体   繁体   English

web.config 的 System.webServer 和 System.web 部分

[英]System.webServer and System.web sections of web.config

What is point to have two separate sections for defining error documents in web.config?在 web.config 中定义错误文档有两个单独的部分有什么意义?

<system.webServer>
...
   <httpErrors errorMode="Custom">
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" prefixLanguageFilePath="" path="/ErrorPage_404.aspx" responseMode="ExecuteURL" />
   </httpErrors>
...
</system.webServer>

and

<system.web>
...
   <customErrors defaultRedirect="/Forms/Errors/Error.aspx" mode="On">
      <error statusCode="404" redirect="/ErrorPage_404.aspx" />
   </customErrors>
...
</system.web>

If I remove first section, IIS7 will not show error pages.如果我删除第一部分,IIS7 将不会显示错误页面。 If I remove second one, my VS debugger will not show error pages.如果我删除第二个,我的 VS 调试器将不会显示错误页面。

I always thought that system.web applied to IIS6 and below, while system.webServer applied to IIS7+, but actually it seems that the real answer is that system.web is for.aspx /.asp pages through its handler mapping, and everything else goes through system.webServer.我一直以为system.web适用于IIS6及以下,而system.webServer适用于IIS7+,但实际上似乎真正的答案是system.web是for.aspx /.asp页面通过其处理程序映射,以及其他一切通过 system.webServer。

Have a look at this webpage for a pretty clear explanation . 看看这个网页以获得非常清晰的解释

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 web.config 中 system.web 和 system.webServer 中的授权之间的区别? - Difference between authorization in system.web and system.webServer in web.config? 运行时访问web.config system.webServer / webSocket部分 - Runtime access to web.config system.webServer/webSocket section 如果指定路径上存在文件,则会忽略web.Config中system.webServer中的处理程序 - Handler in system.webServer in web.Config is ignored if a file exist at the path specified WCF Web.config - 无法读取配置节&#39;system.webserver&#39;,因为它缺少节声明 - WCF Web.config - The configuration section 'system.webserver' cannot be read because it is missing a section declaration 是否可以将“ MVC 5路由”用作web.config的system.webServer httpErrors部分中错误元素中的路径? - Can a “MVC 5 route” be used as a path in an error element in system.webServer httpErrors section in web.config? 在Web.Config的System.Web部分中,AllowLocation =“ true”有什么作用? - What does AllowLocation=“true” do in System.Web section of Web.Config? MS Web Deploy:缺少配置部分`system.webServer / management / delegation` - MS Web Deploy: configuration section `system.webServer/management/delegation` is missing web.config中的外部配置节是否已缓存? - Are external config sections in web.config cached? System.Webserver同时重写并确保安全 - System.Webserver rewrite and secure at the same time 当apphost配置中存在system.web配置时,IIS 8中的HTTP错误500.19 - HTTP Error 500.19 in IIS 8 when system.web configuration is present in apphost config
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM