asp.net – 为什么IIS Express使用而不是?

使用Cassini但切换到IIS Express.我最初的想法是我可以删除所有< system.web>除了以下内容
<authentication mode="Forms">
  <forms loginUrl="/" />
</authentication>

我之前的customErrors设置如下:

<customErrors mode="On" defaultRedirect="/ServerError">
  <error statusCode="404" redirect="/NotFound" />
</customErrors>

我切换到IISExpress时删除了这个customErrors元素.现在404不再重定向到我漂亮的“NotFound”页面了.

用于我的网站的AppPool是Clr4IntegratedAppPool,它让我知道它不使用Classic.

为什么IISExpress如此依赖system.web而IIS 7.5使用system.webServer?

解决方法

好吧,我尝试了一些不同的东西:

>将existingResponse更改为Passthrough,如here所示

< httpErrors errorMode =“Custom”existingResponse =“Replace”>

不!

>如评论here中所述,设置TrySkipIisCustomErrors = false

Notta!

我最终通过简单地将existingResponse更改为Replace来使其工作.

>谁知道!

这就是system.webServer现在的样子:

<httpErrors errorMode="Custom" existingResponse="Replace">
        <remove statusCode="404" subStatusCode="-1" />
        <error statusCode="404" path="/NotFound" responseMode="ExecuteURL" />
        <remove statusCode="500" subStatusCode="-1" />
        <error statusCode="500" path="/ServerError" responseMode="ExecuteURL" />
    </httpErrors>

为什么这个解决方案没有任何意义

Replace – This value make custom error module to always replace the
error information with text generated by custom error module. If
existingResponse is set to “Replace”,errors/exceptions generated by
Asp.Net/WCF are replaced by IIS7 errors.

http://blogs.iis.net/ksingla/archive/2008/02/18/what-to-expect-from-iis7-custom-error-module.aspx

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....