c# - Support for NLog 2.1 -
i want upgrade nlog version 2.1. version of common logging library should use?
i using common logging version 2.0 nlog 2.0. replaced nlog v2.0 2.1 not work. help?
i error - failed obtaining configuration common.logging configuration section 'common/logging'.
you should use common.logging.nlog20 you'll have add assembly redirect :
<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentity name="common.logging" publickeytoken="af08829b84f0328e" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-2.1.2.0" newversion="2.1.2.0" /> </dependentassembly> <dependentassembly> <assemblyidentity name="nlog" publickeytoken="5120e14c03d0593c" culture="neutral" /> <bindingredirect oldversion="0.0.0.0-2.1.0.0" newversion="2.1.0.0" /> </dependentassembly> </assemblybinding>
and common logging config should :
<common> <logging> <factoryadapter type="common.logging.nlog.nlogloggerfactoryadapter, common.logging.nlog20"> <arg key="configtype" value="file" /> <arg key="configfile" value="~/nlog.config" /> </factoryadapter> </logging> </common>
thankfully nuget packages common.logging , adapters has changed (see here) should able use common.logging.nlog21 libarary.
Comments
Post a Comment