Sql server Elmah.MVC-MVC 5 ArgumentNullException:值不能为null。参数名称id:

Sql server Elmah.MVC-MVC 5 ArgumentNullException:值不能为null。参数名称id:,sql-server,asp.net-mvc-5,elmah,elmah.mvc,Sql Server,Asp.net Mvc 5,Elmah,Elmah.mvc,我在尝试呈现elmah错误日志和使用SQL DB时收到一个错误。“”[ArgumentNullException:值不能为null。 参数名称:id] c:\builds\Elmah-1.2-SP2\src\Elmah\ErrorLogEntry.cs:57中的Elmah.ErrorLogEntry..ctor(ErrorLog日志,字符串id,Error Error Error) c:\builds\Elmah-1.2-SP2\src\Elmah\SqlErrorLog.cs:365中的Elm

我在尝试呈现elmah错误日志和使用SQL DB时收到一个错误。“”[ArgumentNullException:值不能为null。 参数名称:id] c:\builds\Elmah-1.2-SP2\src\Elmah\ErrorLogEntry.cs:57中的Elmah.ErrorLogEntry..ctor(ErrorLog日志,字符串id,Error Error Error) c:\builds\Elmah-1.2-SP2\src\Elmah\SqlErrorLog.cs:365中的Elmah.SqlErrorLog.ErrorsXmlToList(XmlReader,IList errorEntryList) c:\builds\Elmah-1.2-SP2\src\Elmah\SqlErrorLog.cs:332中的Elmah.SqlErrorLog.ErrorsXmlToList(字符串xml,IList errorEntryList) c:\builds\Elmah-1.2-SP2\src\Elmah\SqlErrorLog.cs:186中的Elmah.SqlErrorLog.GetErrors(Int32 pageIndex、Int32 pageSize、IList errorEntryList) c:\builds\Elmah-1.2-SP2\src\Elmah\ErrorLogPage.OnLoad(EventArgs e)中的Elmah.ErrorLogPage.OnLoad System.Web.UI.Control.LoadRecursive()+54 System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)+772

我有最新的核心Elmah 1.2-SP2和最新的Elmah.MVC 2.1.2。我安装了带有默认web.config设置的Nuget包Elmah.MVC

当我将web.config配置为将错误记录到数据库中时,错误会记录在数据库中,但我无法呈现错误页面。当我不配置数据库时,elmah页面呈现得很好

  <elmah>
    <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="Company" />
  </elmah>
数据库中的所有错误ID都是填充的GUID


我被难住了,什么样的身份证没有传给核心艾玛。以前有人碰到过这个吗

我下载了核心的Elmah代码,并逐步在SqlErrorLog.cs中找到方法ErrorsXmlToList(XmlReader,IList errorEntryList)中有一个对get id的调用,它缺少参数:string id=reader.GetAttribute(“errorId”);我降低了“errorid”的等级,一切正常。显然,这不是一个好的解决方案,因为这是每个人都使用的核心代码,所以我更深入地研究了它

这使我了解了存储过程ELMAH_GetErrorsXml。我发现在我们的数据库中我们有一个小写的“errorid”。我更新了存储过程以选择“errorId”,并将核心Elmah更改回原始代码,当然一切正常

if (id == null)
        throw new ArgumentNullException("id");
      if (id.Length == 0)
        throw new ArgumentException((string) null, "id");