Мое приложение MVC3 отображает настраиваемые страницы ошибок для кодов состояния 403, 404 и 500, но при просмотре файла trace.axd отображается следующий YSOD:
Server Error in '/' Application.
Trace Error
Description: Trace.axd is not enabled in the configuration file for this application. Note: Trace is never enabled when <deployment retail=true />
Details: To enable trace.axd, please create a <trace> tag within the configuration file located in the root directory of the current web application. This <trace> tag should then have its "enabled" attribute set to "true".
<configuration>
<system.web>
<trace enabled="true"/>
</system.web>
</configuration>
Итак, у меня отключена трассировка, и это хорошо, но почему страница 500 не отображается, поскольку с сервера возвращается ошибка 403? Я был бы достаточно счастлив с 404, 403 или 500 на самом деле - до тех пор, пока это не уродливый желтый экран!
Редактировать: я получал 500 вместе с YSOD при работе на локальном хосте, но на самом деле это 403 на сервере, что ближе к тому, что я ожидал, но по-прежнему нет пользовательской страницы ошибок. Это также немного другая стандартная страница ошибок на сервере:
Server Error in '/' Application.
Trace Error
Description: The current trace settings prevent trace.axd from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable trace.axd to be viewable on remote machines, please create a <trace> tag within the configuration file located in the root directory of the current web application. This <trace> tag should then have its "localOnly" attribute set to "false".
<configuration>
<system.web>
<trace localOnly="false"/>
</system.web>
</configuration>