我閱讀已發佈的所有答案,但似乎沒有解決。 即使我收到了這些警告,Elmah仍然完美無缺地工作。當我在visual studio 2012中啓動調試(f5)時,我也遇到了這些錯誤。構建一切都很好。在web.config中無法找到元素'elmah'的架構信息
配置部分很簡單,所以我真的不知道如何解決這個問題:
<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>
<elmah>
<security allowRemoteAccess="1" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="EvaConnection" />
<!--<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data/ErrorLogs" />-->
<!-- ELMAH class ErrorMailModule.cs has been modified to read config from AppSettings -->
<errorMail from="[email protected]" to="[email protected]" subject="dummy" priority="High" async="true" smtpPort="25" smtpServer="dummy" useSsl="false" userName="[email protected]" password="dummy" noYsod="false" />
</elmah>
爲了將來的參考,GitHub上提供了一個ELMAH模式:https://github.com/elmahio/Elmah-Schema。你可以閱讀更多關於它,並看到如何在這裏使用它的例子:http://blog.elmah.io/the-elmah-schema/ – ThomasArdal