2009-11-03 69 views
2

我控制的代碼,但不是服務器和另一端的人知道盡可能多的IIS和我一樣。可以通過IIS重寫customErrors嗎? (7.0)

我有經典:

<configuration> 
    <system.web> 
     <customErrors mode="Off"/> 
    </system.web> 
</configuration> 
在我的根級別的Web.config

,但我沒有看到錯誤的詳細信息。上述內容是否已被服務器/應用程序級別的設置覆蓋?

+0

你看到了什麼? – Kev 2009-11-05 03:31:40

回答

1

最後,我們並沒有看到錯誤消息的原因是因爲machine.config文件我們開發的服務器從我們的生產服務器被克隆後有<deployment retail="true"/>

<configuration> 
    <system.web> 
      <deployment retail="true"/> 
    </system.web> 
</configuration> 

它需要設置爲false。 Scott Guthrie在他的文章Don’t run production ASP.NET Applications with debug=」true」 enabled中對此進行了詳細闡述。

0

在你的global.asax文件的Application_Error事件中添加處理可以做到這一點,但這將在你的控制之下,我會想象的。

Microsoft KB article here舉例說明。

善良,

+0

目前沒有使用任何global.asax文件。謝謝你的提示。 – furtive 2009-11-03 20:05:28

相關問題