我已經修改我的web.config文件中我的asp.net web應用程序,這樣我顯示自定義錯誤頁:當我運行如何在IIS使用自定義錯誤與ASP.NET
<configuration>
<system.web>
...snip
<customErrors mode="On" defaultRedirect="WebForms/ErrorPage.aspx">
<error statusCode="404" redirect="WebForms/ErrorPageNotFound.aspx" />
</customErrors>
</system.web>
</configuration>
網站上的IIS我得到以下錯誤:
Error code: 0x800700b7
Config section 'system.web/customErrors' already defined.
Sections must only appear once per config file.
See the help topic <location> for exceptions
顯然,我有一些配置層次,在這裏打球,但我不知道我需要看看(我有我的機器上276個web.config文件中),該文件 - 有人能指引我走向正確的方向嗎?
當我找到該文件時,我可以僅刪除頂層customErrors
部分,或者這會導致在同一臺機器上沒有定義customErrors
的其他Web應用程序出現問題?
我在哪裏可以找到根web.config在c:\ inetpub \ wwwroot中沒有任何東西?我嘗試了高級搜索,但它甚至沒有找到我的應用程序web.config文件(!) – 2012-07-25 09:30:07
我的意思是應用程序的根配置文件。無論如何,我更新了我的答案,向您展示了ASP.Net配置層次結構 – Jupaol 2012-07-25 09:40:06