Man*_*ght 9 asp.net elmah web-config configsection
我读了这里已经发布的所有答案,但似乎没有解决.即使我收到警告,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>
Run Code Online (Sandbox Code Playgroud)
我认为这个错误与您选择SqlErrorLog作为errorLog类型的事实有关.您是否在为connectionString配置的数据库中运行Elmah SQL Server数据库脚本EvaConnection?如果没有,则需要执行此操作,以便为Elamh创建正确的表和存储过程,以便在将错误写入数据库时使用.
如果您使用的是SQL Server的更高版本而不是2005,请参阅ErrorLog实现 - 企业级关系数据库维基页面中的注释,以获取有关ntext字段类型的说明.
更新:
在更加关注这个问题之后.在ELMAH Google Group上找到相关帖子- 无法找到架构信息这是Visual Studio报告有关ELMAH配置部分的问题,因为它没有支持的.xsd文件.有一个可用的文件可用于在Visual Studio中禁止此错误/警告消息.只需按照问题239:Intellisense for web.config和外部配置文件中的说明操作即可
| 归档时间: |
|
| 查看次数: |
6216 次 |
| 最近记录: |