asp.net - 找不到元素 'elmah'的架构信息

标签 asp.net web-config elmah configsection

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

web.config中的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>

最佳答案

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

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

更新:

之后再多注意这个问题。在ELMAH Google Group - Could not find schema information上找到了相关的帖子这是Visual Studio报告的有关ELMAH config部分的问题,因为它没有支持的.xsd文件。没有可用的文件,可用于在Visual Studio中禁止显示此错误/警告消息。只需按照Issue 239: Intellisense for web.config and external config files的说明进行操作

关于asp.net - 找不到元素 'elmah'的架构信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13914086/

相关文章:

c# - 确定是否启用了 ELMAH?

asp.net - 为网站添加配置转换

没有 SSL 但具有 Windows 组身份验证的 WCF 服务

asp.net - 使用 Active Directory 对面向 WWW 的网站中的用户进行身份验证

javascript - 当 javascript 以编程方式更改文本框值时调用服务器端方法

asp.net-mvc - ASP.NET MVC 预览版 5 - Html.Image 助手已移动命名空间

Elmah 不会通过 iis 7.5 express 记录或读取错误

asp.net-mvc-3 - 在异步任务中登录 Elmah

c# - ASP.NET Web API 下载文本

asp.net - HTTP 403 - 图像在 IE 中不显示,但在所有其他浏览器中显示