10

我阅读了这里已经发布的所有答案,但似乎没有一个可以解决。即使我收到这些警告,Elmah 的工作也完美无缺。当我在 Visual Studio 2012 中启动调试 (f5) 时,我也遇到了这些错误。在构建时一切都很好。

web.config 中的配置部分很简单,所以我真的不知道如何解决它:

<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="dummy@dummy.com" to="dummy@dummy.com" subject="dummy" priority="High" async="true" smtpPort="25" smtpServer="dummy" useSsl="false" userName="dummy@dummy.com" password="dummy" noYsod="false" />
  </elmah>
4

2 回答 2

10

我认为这个错误与您选择 SqlErrorLog 作为您的 errorLog 类型有关。您是否在您的connectionString 配置的数据库中运行了Elmah SQL Server DB 脚本?EvaConnection如果没有,您将需要这样做,以便为 Elamh 创建正确的表和存储过程,以便在将错误写入数据库时​​使用。

如果您使用的 SQL Server 版本高于 2005,请参阅ErrorLog Implementation - Enterprise-Level Relational Databases wiki 页面中的注释以获取有关ntext字段类型的注释。

更新:

多关注问题后。在 ELMAH Google Group 上找到相关帖子- 找不到架构信息这是 Visual Studio 报告的有关 ELMAH 配置部分的问题,因为它没有支持的 .xsd 文件。有一个文件可用于在 Visual Studio 中抑制此错误/警告消息。只需按照问题 239 中的说明进行操作:用于 web.config 和外部配置文件的 Intellisense

于 2012-12-21T02:56:04.577 回答
2

我让一切正常,然后我也遇到了这个错误。

在尝试解决此问题的任何更复杂的解决方案之前:

  1. 重新启动 Visual Studio
  2. 清洁溶液
  3. 再次构建解决方案

这为我解决了问题。似乎某些东西在 Visual Studio 中被缓存(或崩溃)了。

于 2015-07-24T15:27:16.303 回答