微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

asp.net – 找不到元素’elmah’的架构信息

我读了这里已经发布的所有答案但似乎没有解决.
即使我收到了警告,Elmah也能完美地工作.当我在visual studio 2012中启动debug(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>

解决方法

我认为这个错误与您选择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配置部分的问题,因为它没有支持的.xsd文件.有一个可用的文件可用于在Visual Studio禁止错误/警告消息.只需按照Issue 239: Intellisense for web.config and external config files的说明操作即可

原文地址:https://www.jb51.cc/aspnet/248636.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐