2011-12-02 3 views
0

응용 프로그램에서 WCF 문제를 해결하고 다음과 같은 sharedListener를 추가 한 VS 2010의 WCF 서비스 구성 편집기를 사용하여 WCF 추적을 설정했습니다. 의 Web.config : 이제CLR 동일한 어셈블리에 있어도 형식을 찾을 수 없습니다.

<sharedListeners> 
     <add initializeData="D:\Logs\CRCCustomerService\Web_tracelog.svclog" 
     type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" 
     name="ServiceModelTraceListener" traceOutputOptions="Timestamp"> 
     <filter type="" /> 
     </add> 
    </sharedListeners> 

, 내 오류를 재현하기위한 조치를 취할 때, 나는 그것이 XmlWriterTraceListener 찾을 수없는 것을 말하는 System.Diagostics 라이브러리에서 던진 예외 받고 있어요 :

Stack Trace: 
System.TypeInitializationException: The type initializer for  'System.ServiceModel.DiagnosticUtility' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Couldn't find type for class System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. 
at System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData) 
at System.Diagnostics.TypedElement.BaseGetRuntimeObject() 
at System.Diagnostics.ListenerElement.GetRuntimeObject() 
at System.Diagnostics.ListenerElement.GetRuntimeObject() 
at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() 
at System.Diagnostics.TraceSource.Initialize() 
at System.Diagnostics.TraceSource.get_Listeners() 

그리고 몇 줄 더 계속되지만, 이렇게 설정됩니다. 문맥.

내 질문은 ObjectBrowser 및 Reflector에 따라 XmlWriterTraceListener가 System.Diagnostics와 동일한 어셈블리의 멤버 클래스이므로 어떻게 찾을 수 없습니까?

둘째, 예외 스택의 모든 단일 라인이 시스템 코드에서 나옵니 까, 근본 원인을 어떻게 디버깅하기 시작합니까?

+0

모든 어셈블리 정보를 제거하고이 유형을 그대로 남겨 봤습니까 = "System.Diagnostics.XmlWriterTraceListener" –

답변

1

.NET 4.0을 사용하고 있습니까?

그렇지 않은 경우 서비스 구성 유틸리티를 조심해야합니다. Listener 버전을 4.0으로 하드 코딩하면 web.config를 수동으로 변경해야합니다.

관련 문제