Can't get / elmah on a server with Elmah MVC?

I installed the elgah.mvc nuget package and saved the default configuration, which does not allow sending email and connecting it to the SQL database.

On my local machine, when I use the Visual Studio host, I can open the application and access / elmah fine to see the error report. However, when I try to access / elmah in 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. 

Does anyone know what is going on here and how to fix it? Thank.

I tried the following, which was suggested 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 to set the path to elmah.axd and just ~/elmah . Everyone still gives the same error and still works locally, but not in production.

Edit: It also works when I retire to the server and access it through a browser (not using localhost, but the actual site address). So what permission do I not have? It looks like server level.

+52
c # asp.net-mvc elmah
Jul 26 '12 at 17:09
source share
2 answers

You need to enable Elmah for remote access by adding the following configuration parameter to the <elmah> section in the web.config file. The default value for this value is false, which allows only localhost, so it works on your local machine from Visual Studio.

  <elmah> <security allowRemoteAccess="true"/> </elmah> 

I always seem to have forgotten it myself and spent a few minutes scratching my head;)

+114
Jul 27 '12 at 2:45
source share

Verify that the HttpHandler is defined in the webServer section of the web.config file.

 <system.webServer> <httpHandlers> <add name="elmah" verb="GET" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/> </httpHandlers> </system.webServer> 
+1
Jul 26 '12 at 17:10
source share



All Articles