I have an MVC WebAPI site that has the latest ELMAH.MVC NuGet package installed. In Visual Studio, I can access
http:
and get the error log, as I should.
When I deploy it to Azure, it causes an error when I do this. Fortunately, Elmah logs an error in the XmlError log in App_Data, and I found this:
<error errorId="92ad3ee1-3fd5-449a-8cb4-0474aa771aab" application="/LM/W3SVC/417796901/ROOT" host="RD00155D430783" type="System.Web.HttpException" message="Server cannot set status after HTTP headers have been sent." source="System.Web" detail="System.Web.HttpException (0x80004005): Server cannot set status after HTTP headers have been sent.

And then they continue for many stack trace lines, NONE of which are approaching my code.
What's happening? I just added the Elmah.MVC nuget package and made the following changes to Web.Config
<elmah> <security allowRemoteAccess="yes"/> <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" /> </elmah> <location path="elmah.axd"> <system.web> <allow roles="*" /> </system.web> </location>
It never comes close to any of my controllers, so I cannot control when the HTTP status headers are set or sent.
Thanks for any help.
source share