.net 操作可能会破坏运行时企业库6的稳定性

.net 操作可能会破坏运行时企业库6的稳定性,.net,logging,enterprise-library,verificationexception,.net,Logging,Enterprise Library,Verificationexception,我创建了一个.NET4.5控制台应用程序,在新的EntLibV6中尝试语义日志记录。 使用PDF中的示例代码: var listener2 = new ObservableEventListener(); listener2.EnableEvents( EventSourceCore.Log , EventLevel.LogAlways , Keywords.All ); SinkSubscription<SqlDatabaseSink> subscription = listene

我创建了一个.NET4.5控制台应用程序,在新的EntLibV6中尝试语义日志记录。 使用PDF中的示例代码:

var listener2 = new ObservableEventListener();
listener2.EnableEvents( EventSourceCore.Log , EventLevel.LogAlways , Keywords.All );
SinkSubscription<SqlDatabaseSink> subscription = listener2.LogToSqlDatabase( "Demo Semantic Logging Instance" , ConfigurationManager.AppSettings["mdbconn"] );
查看Entlib源代码,SqlDatabaseSink.cs中的第32行显示

 private readonly RetryPolicy retryPolicy = new RetryPolicy<SqlDatabaseTransientErrorDetectionStrategy>(5, TimeSpan.FromSeconds(1), TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(5));
但我没有看到任何类似于隐式转换的东西会导致这个问题,这在其他SO帖子中都有发现

我错过了什么?有人真的看到过“开箱即用”的记录模块吗


谢谢,

问题出在核心MS库中

包含该问题的修补程序。我在那上面花了好几个小时。希望下一个尝试这个的人不会浪费同样的时间

 private readonly RetryPolicy retryPolicy = new RetryPolicy<SqlDatabaseTransientErrorDetectionStrategy>(5, TimeSpan.FromSeconds(1), TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(5));
 public RetryPolicy(int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
            : base(new T(), retryCount, minBackoff, maxBackoff, deltaBackoff)