NuGet 패키지를 사용하여 Common.Logging이 ASP.Net MVC 프로젝트에서 NLog2를 사용하도록 구성하려고합니다. 아래 URL에 제공된 정보를 기반으로 로거가 올바르게 구성되어 있지만 구성 오류가 계속 발생합니다.어떻게 Common.Logging을 성공적으로 구성 할 수 있습니까?
<configuration>
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog20">
<arg key="configType" value="INLINE" />
</factoryAdapter>
</logging>
</common>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="logfile" xsi:type="file" filename="e:\logfile.txt" layout="${date:format=yyyy/MM/dd HH:mm:ss} ${message}" />
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="logfile" />
</rules>
</nlog>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Common.Logging" publicKeyToken="af08829b84f0328e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
는 지금까지 내가 말할 수있는 건,이 모든 것을 내가해야입니다
:
Common.Logging Configuration Instructions
나는 지시에 따라 의 web.config에 다음을 추가했습니다 해야하지만 웹 프로젝트를 실행하려고하면 구성 오류가 발생합니다 ...
파서 오류 메시지 : 오류가 일반적인/로깅에 대한 구성 섹션 처리기 만들기 발생 : 유형 만들 수 없습니다 'Common.Logging.NLog.NLogLoggerFactoryAdapter을 Common.Logging.NLog20'
수있는 사람의 서비스 누락 또는 오류에 대한 제안?
흠 나는 존재하지 않는다고 생각합니다 - 로깅 어셈블리의 오류가 켜져 있어야합니다 (실제로는 확실하지 않습니다) –
이것은 실제로는 미신적 인 답변이 아닙니다 : 'Common.Logging.NLog'유형을 생성 할 수 없습니다. NLogLoggerFactoryAdapter, Common.Logging.NLog2 ' – PUG