I have installed Elmah.MVC into a project I'm working on and tried to browse to /elmah but am constantly greeted by this error:
You are attempting to access ELMAH from a remote machine whereas itis currently configured not to allow remote access. You can enableremote access by adding the following sections to this web site'sconfiguration file:
<configuration>
<configSections>
…
<sectionGroup name="elmah">
<section name="security" type="Elmah.SecuritySectionHandler, Elmah" />
</sectionGroup>
…
</configSections>
<elmah>
<security allowRemoteAccess="yes" />
</elmah>
…
</configuration>
The thing is, I'm running the application in Debug mode on my Local Machine and not remotely.
My Web Config looks as follows:
<configuration>
<configSections>
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
</configSections>
......
<appSettings>
<add key="elmah.mvc.disableHandler" value="false" />
<add key="elmah.mvc.disableHandleErrorFilter" value="false" />
<add key="elmah.mvc.requiresAuthentication" value="false" />
<add key="elmah.mvc.IgnoreDefaultRoute" value="false" />
<add key="elmah.mvc.allowedRoles" value="*" />
<add key="elmah.mvc.allowedUsers" value="*" />
<add key="elmah.mvc.route" value="elmah" />
<add key="elmah.mvc.UserAuthCaseSensitive" value="true" />
</appSettings>
......
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
......
<system.webServer>
<modules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
</modules>
</system.webServer>
......
<elmah>
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="Elmah" />
<security allowRemoteAccess="false" />
</elmah>
</configuration>
I've used Elmah before in other projects without encountering this issue. I'm using Visual Studio 2017, MVC5 and .NET Framework 4.5.2
Anyone have any ideas?
I HAD the same issue. I was definitively accessing locally, I tried "localhost" and "127.0.0.1". But I could make it work with another smaller MVC project, at least remotely.
Comparing both, I noticed differences in the version of elmah.corelibrary, and I believe now that the latest version, 1.2.2 causes the issue.
So, I replaced 2 dll and have now
and updated package.config :
In the Root web.config, I have the following lines related to elmah
in the configSections section :
in the appSettings section :
in the system.web section :
in the system.webserver section :
and under configuration
I struggled a lot to make it all work. This last attribute can of course be set to false (and it still works locally) I hope it works for you!