16

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.

4

1 回答 1

21

做一个

<remove name="ErrorLog"/>

之前

<add />

删除modulesweb.config 文件部分中名为 ErrorLog 的任何默认定义的条目。

于 2013-07-29T16:14:33.837 回答