Can't access /elmah on production server with Elmah MVC?

前端 未结 2 1011
耶瑟儿~
耶瑟儿~ 2020-12-08 03:35

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

相关标签:
2条回答
  • 2020-12-08 04:38

    Make sure you HttpHandler is defined in the webServer section in your web.config file.

    <system.webServer>
      <httpHandlers>
        <add name="elmah" verb="GET" path="elmah.axd"  type="Elmah.ErrorLogPageFactory, Elmah"/>
      </httpHandlers>
    </system.webServer>
    
    0 讨论(0)
  • 2020-12-08 04:40

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

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

    I always seem to forget this myself and spend a few minutes scratching my head ;)

    0 讨论(0)
提交回复
热议问题