.net - Cannot see detailed errors of Internal Server 500 errors -
i running microsoft asp.net web api 2.1 application in iis7.5 , getting generic:
500 - internal server error.
there problem resource looking for, , cannot displayed.
i have tried following more detail on actual error far, face palming:
- set
globalconfiguration.configuration.includeerrordetailpolicy = includeerrordetailpolicy.always;
- added
<system.webserver> <httperrors existingresponse="passthrough"/> </system.webserver>
- checked windows event log unhandled exceptions, none
added
exceptionlogger
, nothing appears in log file:public class log4netexceptionlogger : exceptionlogger { private readonly ilog _log = logmanager.getlogger(typeof(log4netexceptionlogger)); public override void log(exceptionloggercontext context) { _log.error("an unhandled exception occurred.", context.exception); base.log(context); } }
added
<configuration> <system.webserver> <httperrors errormode="detailed" /> <asp scripterrorsenttobrowser="true"/> </system.webserver> <system.web> <customerrors mode="off"/> <compilation debug="true"/> </system.web> </configuration>
- browsed locally , "this page can't displayed" in ie, binding not localhost
i see 500 responses in iis logs, no detail error.
create binding localhost website , navigate http://localhost within web browser on server.
since request coming localhost, iis show error details in browser.
not great solution, fastest i've found far.