Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elmah.MVC working under IIS Express but not IIS 7.5

I'm trying to get Elmah working under ASP.NET MVC and I thought I had. I used the very convenient Elmah MVC project which automatically setup my web.config file. Now if I run the project under IIS Express then Elmah works just perfectly. I can access it with the correct Authorisation and the logs are stored in my SQL Database. However when I try and run it under IIS 7.5 I get an:

An HTTP 500.19 Internal Server error 
Module  IIS Web Core
Notification    BeginRequest
Handler Not yet determined
Error Code  0x800700b7
Config Error    Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'ErrorLog'
Config File web.config

Config Source:
  111:     <modules>
  112:       <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
  113:     </modules>

I'm baffled as to why this might be. As a test I've created a brand new clean MVC project and it reacts exactly the same way.

like image 569
Chris Nevill Avatar asked Jul 29 '13 15:07

Chris Nevill


1 Answers

do a

<remove name="ErrorLog"/>

before the

<add />

to get rid of any default defined entries named ErrorLog in the modules section of your web.config file.

like image 63
rene Avatar answered Sep 18 '22 22:09

rene