2011-09-13 2 views
2

내가 'Microsoft.Practices.EnterpriseLibrary.Logging.Logger'에 대한 Microsoft.Practices.EnterpriseLibrary.LoggingC#의 Microsoft.Practices.EnterpriseLibrary.Logging 오류

형식 이니셜을 사용하려고 할 때 나는 오류를 얻고있다 던졌다 예외. 내 구성에서, "configSection"의 선언해야한다는 발견하는 경우

<configSections> 
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null" /> 
    </configSections> 
    <loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="Tracing" logWarningsWhenNoCategoriesMatch="true"> 
    <listeners> 
     <add fileName="F:\Service\Service\log\Full\Service.log" rollSizeKB="1024" timeStampPattern="yyyy-MM-dd" rollFileExistsBehavior="Increment" rollInterval="None" formatter="Text Formatter" header="" footer="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null" traceOutputOptions="LogicalOperationStack" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null" name="AppLog" /> 
    </listeners> 
    <formatters> 
     <add template="{timestamp} : {message}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null" name="Text Formatter" /> 
    </formatters> 
    <categorySources> 
     <add switchValue="All" name="AppLog"> 
     <listeners> 
      <add name="AppLog" /> 
     </listeners> 
     </add> 
     <add switchValue="Verbose" name="ExceptionHandling"> 
     <listeners> 
      <add name="Exception" /> 
     </listeners> 
     </add> 
     <add switchValue="Information" name="Tracing"> 
     <listeners> 
      <add name="Trace" /> 
     </listeners> 
     </add> 
    </categorySources> 
    <specialSources> 
     <allEvents switchValue="All" name="All Events" /> 
     <notProcessed switchValue="All" name="Unprocessed Category" /> 
     <errors switchValue="Off" name="Logging Errors Warnings" /> 
    </specialSources> 
    </loggingConfiguration> 

어떤 도움도, 시간이 오래 걸리면

감사

K

답변

1
나는이 문제에 직면

이후를 이해할 수있을 것이다 첫 번째 태그. 그 전에 다른 태그가 있으면 같은 오류가 발생합니다.

필자의 경우 구성 전에 대상 프레임 워크 태그가있었습니다. 그 후로 옮겨서 작동을 시작합니다.