0

I have VS2015 with MVC5 and I installed Nuget package Elmah.MVC But I am not able to get it to work. When I submit URL address

localhost:<port>/Elmah.axd 

the error appear

HTTP Error 404.0 - Not Found

in web.config by default nugget package added this

    <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>

    ...
    <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>

<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>

I added manually this, because I tried to fix the error and also want to store application errors in the SQL database

    <system.web>
    ...
    <httpHandlers>
         <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
      </httpHandlers>
    ...
    </system.web>

    <configuration>
...
    <elmah>
        <errorLog type="Elmah.SqlErrorLog, Elmah" 
          connectionStringName="database" 
          applicationName="MyAppName"/>
      </elmah>
    </configuration>

What am I missing ?

Muflix
  • 6,192
  • 17
  • 77
  • 153

1 Answers1

0

I recently installed and your config looks similar except I have these:

  <system.web> ..
    <httpModules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
      <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
      <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
    </httpModules>
  </system.web>

. . .

  <elmah>
    <security allowRemoteAccess="yes" />
  </elmah>
</configuration>

I do not have the entries you manually added.

DanO
  • 407
  • 5
  • 15