久久久久久久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模板網(wǎng)!

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

相關文檔推薦

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屋-程序員軟件開發(fā)技
.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 超時)
主站蜘蛛池模板: www.中文字幕.com| 一级全黄少妇性色生活免费看 | 色眯眯视频在线观看 | 男女羞羞视频在线看 | 羞羞视频网站在线观看 | 久草新在线 | 久久精品视频在线观看 | 久久99精品久久久久久 | 中文字幕1区2区 | 久久久久国产精品午夜一区 | 成人免费毛片在线观看 | 欧美日韩精品影院 | 美女一区 | 性欧美hd| 在线一区二区三区 | 国产精品视频免费观看 | 欧美综合一区 | 欧美激情在线一区二区三区 | 亚洲一区精品视频 | 尤物视频在线免费观看 | 日韩欧美一区二区三区四区 | av天天澡天天爽天天av | 一区二区三区欧美在线观看 | 国产激情片在线观看 | 久草久草久草 | 精品国产女人 | 国产一区二区免费 | 国产成人一区二区 | 亚洲麻豆| 黄色毛片一级 | 亚洲一区二区中文字幕 | 一区二区三区免费在线观看 | 亚洲欧美一区二区三区视频 | 夜夜骑综合| 金莲网 | 亚洲高清在线观看 | 亚洲视频在线观看一区二区三区 | av免费网站在线观看 | 精品国产不卡一区二区三区 | 中文字幕成人av | 亚洲欧美男人天堂 |