久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

IIS7 上托管的 ASP.NET 應用程序忽略自定義錯誤并回

ASP.NET Application hosted on IIS7 that is ignoring custom errors and falls back to IIS errors(IIS7 上托管的 ASP.NET 應用程序忽略自定義錯誤并回退到 IIS 錯誤)
本文介紹了IIS7 上托管的 ASP.NET 應用程序忽略自定義錯誤并回退到 IIS 錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我有一個 C# Web 表單 ASP.NET 4.0 Web 應用程序,由于某種原因,我的 web.config 的 system.web 部分中定義的自定義錯誤被完全忽略,它會回退 IIS 錯誤.

I have a C# web forms ASP.NET 4.0 web application that uses Routing for URLs for some reason custom errors defined in the system.web section of my web.config is entirely ignored and it will fall back the IIS errors.

這完全被忽略了

  <system.web>
    <customErrors mode="On">
      <error statusCode="500" redirect="~/Error" />
      <error statusCode="404" redirect="~/404" />
      <error statusCode="403" redirect="~/Error" />
    </customErrors>
  </system.web>

這部分接管

  <system.webServer>
    <httpErrors>
      <!--<clear />-->
      <remove statusCode="500" subStatusCode="-1" />
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" subStatusCode="-1" path="/App1/404" responseMode="Redirect" />
      <error statusCode="500" prefixLanguageFilePath="" path="/App1/Error" responseMode="Redirect" />
    </httpErrors>
  </system.webServer>

這將是一個小小的不便,除了它回退到 IIS 原生而不是我的應用程序這一事實之外,它完全繞過 Elmah 正確記錄我的 404 異常.

This would be a minor inconvenience except that by the fact it falls back to IIS native instead of my application it completely circumvents Elmah logging my 404 exceptions correctly.

為了避免任何此類建議,我只在 customErrors 停止工作后添加了 httpErrors 配置,所以我會得到任何東西.

Just to avoid any suggestions of such I only added the httpErrors configuration after customErrors stopped working so I would have anything.

推薦答案

要禁用必須設置的 IIS 錯誤消息

To disable the IIS error messages you have to set

  Response.TrySkipIisCustomErrors = true;

在您的錯誤頁面中.之后,您的錯誤消息應該沒有問題地顯示.

in your error page. After that, your Error messages should show without problem.

這篇關于IIS7 上托管的 ASP.NET 應用程序忽略自定義錯誤并回退到 IIS 錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests(ASP.NET Core 使用 Azure Active Directory 進行身份驗證并跨請求保留自定義聲明)
ASP.NET Core 2.0 Web API Azure Ad v2 Token Authorization not working(ASP.NET Core 2.0 Web API Azure Ad v2 令牌授權不起作用)
ASP Core Azure Active Directory Login use roles(ASP Core Azure Active Directory 登錄使用角色)
How do I get Azure AD OAuth2 Access Token and Refresh token for Daemon or Server to C# ASP.NET Web API(如何獲取守護進程或服務器到 C# ASP.NET Web API 的 Azure AD OAuth2 訪問令牌和刷新令牌) - IT屋-程序員軟件開發技
.Net Core 2.0 - Get AAD access token to use with Microsoft Graph(.Net Core 2.0 - 獲取 AAD 訪問令牌以與 Microsoft Graph 一起使用)
Azure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(異步調用時 Azure KeyVault Active Directory AcquireTokenAsync 超時)
主站蜘蛛池模板: 欧美精品v国产精品v日韩精品 | 日本一级淫片免费啪啪3 | 欧美日韩免费视频 | 亚洲精品亚洲人成人网 | 国产精品久久久久久久久 | 国产精品久久久久国产a级 欧美日本韩国一区二区 | 欧美综合久久 | 欧美一级特黄aaa大片在线观看 | 亚洲三区视频 | 国产精品自在线 | 在线电影日韩 | 欧美日韩a | 日韩理论电影在线观看 | 国产高清毛片 | 国产精品中文字幕一区二区三区 | 日韩免费看视频 | 日韩一区在线观看视频 | 欧美国产一区二区 | 在线色| 日本高清精品 | 国产精品久久久久一区二区三区 | 欧美专区日韩 | 中文字幕在线免费视频 | 精精国产xxxx视频在线播放 | 国产美女特级嫩嫩嫩bbb片 | 欧美中文字幕一区二区 | 亚洲视频中文字幕 | 久久狠狠 | 欧美激情精品久久久久久 | 黄色一级大片在线免费看产 | 久久在线 | 91一区二区 | 亚洲激情av | h视频亚洲| 午夜激情影院 | 最近中文字幕第一页 | 五月天婷婷久久 | 黄色免费在线观看 | 国产91九色 | 欧美午夜精品久久久久久浪潮 | 国产网站在线播放 |