EnterpriseLibrary.Logging终止应用程序

时间:2012-09-05 12:27:08

标签: c# logging enterprise-library

我们使用一些使用Microsoft.EnterpriseLibrary.Logging的第三方软件 作为一种服务运行。

最近该服务停止了很多次。我们只有来自Windows事件日志的数据。 Stacktrace显示MS EntLib Logging抛出了ArgumentNullException。

Event Type: Error Event Source: .NET Runtime Event Category: None Event ID: 1026 Date: 04/09/2012 Time: 19:05:23 User: N/A Computer: XXX Description: Application: XXX.Service.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.ArgumentNullException Stack: at Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry.BuildCategoriesCollection(System.String) at Microsoft.Practices.EnterpriseLibrary.Logging.Tracer.WriteTraceMessage(System.String, System.String, System.Diagnostics.TraceEventType) at Microsoft.Practices.EnterpriseLibrary.Logging.Tracer.WriteTraceEndMessage(System.String) at Microsoft.Practices.EnterpriseLibrary.Logging.Tracer.Dispose(Boolean) at Microsoft.Practices.EnterpriseLibrary.Logging.Tracer.Dispose() at XXX

我检查了这个,看起来它是由以下原因造成的:

Trace.CorrelationManager.LogicalOperationStack.Peek()

返回null

任何人都可以帮助我为什么会这样吗?

1 个答案:

答案 0 :(得分:0)

此问题似乎也是以前版本中E-Lib的已知错误。

称为:从多个线程使用日志记录AB时出现未处理的异常。

“潜在的问题是,在.NET 2.0 RTM中,如果在创建子项时存在这样的堆栈,则父子线程的操作堆栈与其子项共享。”

在此处阅读更多内容:http://entlib.codeplex.com/workitem/9592

很难建议一个通用的解决方案,因为它非常依赖于你的应用程序的架构。

相关问题