I installed the elmah.mvc nuget package and kept the default configuration of that sans setting up sending an email and plugging it into a SQL database.
On my local machine when I use the Visual Studio host, I can open my app and access /elmah fine to see a report of the errors. However, when I try and access /elmah on production, I get two errors, first I get a 403 access is denied
server error. Then in my email (from elmah) I get:
System.Web.HttpException: Server cannot set status after HTTP headers have been sent.
Anyone know what is going on here and how to fix? Thanks.
I tried the following so far as suggested by the answers below:
In <system.webServer>
<handlers>
<add name="elmah" verb="GET" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
</handlers>
And in <system.web>
<httpHandlers>
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
I tried setting the path to both elmah.axd
and simply ~/elmah
. All still give the same error, and still works locally, but not in production.
Edit: It actually also works when I remote into the server and access it via browser on there (not using localhost, but the actual site address). So what permission am I not having? Seems like it's at the server level.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…