2014-02-28 1 views
1

NLog와 common.logging을 처음으로 사용하려고합니다. 테스트 프로젝트에서 NLog를 구현했는데 모두 괜찮 았고 common.logging을 적용하려고 시도했지만 다소 어려움을 겪고 있습니다. 의 App.configNLog 1.5 Common.Logging.NLog10을 설치할 수 없습니다. NLoggerFactoryAdapter

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <configSections> 
     <sectionGroup name="common"> 
      <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> 
     </sectionGroup> 
    </configSections> 
    <common> 
     <logging> 
      <factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog10"> 
       <arg key="configType" value="FILE" /> 
       <arg key="configFile" value="~/NLog.config" /> 
      </factoryAdapter> 
     </logging> 
    </common> 
</configuration> 

내가지고있어 오류가 317

private static ILoggerFactoryAdapter BuildLoggerFactoryAdapterFromLogSettings(LogSetting setting) 
     { 
... 
adapter = (ILoggerFactoryAdapter)Activator.CreateInstance(setting.FactoryAdapterType, args); 
... 
} 

것은 내가 configType과에서 configFile을 모두 볼 수있는 디버깅하는 동안 Common.Logging.LogManager 라인에 아래 구성을 Common.logging

args 전달됩니다.

내 NLog.config가 항상 내 대에서 복사 설정

내가 오류는 다음과 같습니다

An unhandled exception of type 'Common.Logging.ConfigurationException' occurred in NLogTutorial1.exe 

Additional information: Unable to create instance of type Common.Logging.NLog.NLogLoggerFactoryAdapter. Possible explanation is lack of zero arg and single arg NameValueCollection constructors 

비주얼 스튜디오 2008

Common.Logging 버전 2.1.1

NLog 버전 1.5

C# 프레임 워크 3.5

콘솔 프로젝트

답변