我在尝试呈现 elmah 错误日志和使用 SQL DB 时收到错误消息。" http://localhost:5525/elmah" [ArgumentNullException: 值不能为空。参数名称:id] Elmah.ErrorLogEntry..ctor(ErrorLog log, String id, Error error) in c:\builds\ELMAH-1.2-SP2\src\Elmah\ErrorLogEntry.cs: 57 Elmah.SqlErrorLog.ErrorsXmlToList(XmlReader reader, IList errorEntryList) 在 c:\builds\ELMAH-1.2-SP2\src\Elmah\SqlErrorLog.cs:365 Elmah.SqlErrorLog.ErrorsXmlToList(String xml, IList errorEntryList) 在 c:\ c:\builds\ELMAH-1.2-SP2\src\Elmah\SqlErrorLog 中的 builds\ELMAH-1.2-SP2\src\Elmah\SqlErrorLog.cs:332 Elmah.SqlErrorLog.GetErrors(Int32 pageIndex, Int32 pageSize, IList errorEntryList)。 c:\builds\ELMAH-1.2-SP2\src\Elmah\ErrorLogPage.cs:186 Elmah.ErrorLogPage.OnLoad(EventArgs e):76 System.Web.UI.Control.LoadRecursive() +54 System.Web。 UI.Page.ProcessRequestMain(布尔包括StagesBeforeAsyncPoint,布尔型 includeStagesAfterAsyncPoint) +772
我有最新的 Core 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>
反编译 Elmah 我在引发参数的构造函数中看到。
if (id == null)
throw new ArgumentNullException("id");
if (id.Length == 0)
throw new ArgumentException((string) null, "id");
我在数据库中的所有 ErrorId 都是填充的 GUID。
我对没有将什么 id 传递给核心 elmah 感到困惑。有没有人遇到过这个?