2013-08-28 4 views
4

새 Ent Lib v6에서 시맨틱 로깅 비트를 시험해보기 위해 .NET 4.5 콘솔 앱을 만들었습니다. PDF 파일에서 샘플 코드를 사용 : 코드를 실행작업으로 인해 런타임이 불안정해질 수 있습니다. Enterprise Library 6

var listener2 = new ObservableEventListener(); 
listener2.EnableEvents(EventSourceCore.Log , EventLevel.LogAlways , Keywords.All); 
SinkSubscription<SqlDatabaseSink> subscription = listener2.LogToSqlDatabase("Demo Semantic Logging Instance" , ConfigurationManager.AppSettings["mdbconn"]); 

즉시 오류 "작업 런타임을 불안정하게 할 수"를 제공합니다. VS2012에서 예외 헬퍼 내의 스택 트레이스를 찾고, I는 Entlib 소스 코드를 찾고

at Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.RetryPolicy`1..ctor(Int32 retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff) 
    at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks.SqlDatabaseSink..ctor(String instanceName, String connectionString, String tableName, TimeSpan bufferingInterval, Int32 bufferingCount, Int32 maxBufferSize, TimeSpan onCompletedTimeout) 
    at Microsoft.Practices.EnterpriseLibrary.SemanticLogging.SqlDatabaseLog.LogToSqlDatabase(IObservable`1 eventStream, String instanceName, String connectionString, String tableName, Nullable`1 bufferingInterval, Int32 bufferingCount, Nullable`1 onCompletedTimeout, Int32 maxBufferSize) 
    at svc2.Program.LogPrep() in c:\cos\Program.cs:line 66 
    at svc2.Program.Main(String[] args) in c:\cos\Program.cs:line 23 
    at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) 
    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) 
    at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() 
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
    at System.Threading.ThreadHelper.ThreadStart() 

참조 SqlDatabaseSink.cs 라인 32
private readonly RetryPolicy retryPolicy = new RetryPolicy<SqlDatabaseTransientErrorDetectionStrategy>(5, TimeSpan.FromSeconds(1), TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(5)); 

가 RetryPolicyGeneric.cs 59 행으로가는 도시 그
public RetryPolicy(int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff) 
      : base(new T(), retryCount, minBackoff, maxBackoff, deltaBackoff) 

을 보여줍니다하지만 문제의 원인이 될 수있는 암시 적 캐스트처럼 아무것도 표시되지 않습니다, 그것은 다른 SO 게시물에서 발견되었다.

무엇을 놓쳤습니까? 실제로 "로깅 차단"작업을 본 사람은 누구입니까?

감사합니다.

답변

5

문제는 핵심적인 MS 라이브러리에 있습니다. 이 문제에 대한 패치가 포함되어

http://support.microsoft.com/kb/2748645

. 나는 그 시간에 몇 시간을 불 태웠다. 희망을 갖고 다음 사람은 같은 시간을 잃지 않아도됩니다.