我收到以下错误:
---------------------------
Microsoft Visual Studio
---------------------------
Could not load the assembly Common.Logging.NLog because the following errors occurred:
Could not load type 'NLog.TargetWithLayout' from assembly 'NLog, Version=2.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c'.
---------------------------
OK
---------------------------
当我尝试使用DataContext
编辑器/选择器时,任何 Window/Usercontrol 属性。我从 NuGet 拉下两个程序集
NLog 配置:
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
throwExceptions="false">
<!--
See http://nlog-project.org/wiki/Configuration_file
for information on customizing logging rules and outputs.
-->
<variable name="appName" value="APPLICATION" />
<targets async="true">
<target xsi:type="File"
name="default"
fileName="${specialfolder:ApplicationData}/APPLICATION/logs/${shortdate}.log"
layout="${longdate} | ${uppercase:${level}} | ${message}${onexception:${newline}EXCEPTION\: ${exception:format=ToString}}"
keepFileOpen="false" />
<target xsi:type="File"
name="debug"
fileName="${specialfolder:ApplicationData}/APPLICATION/logs/${shortdate}_debug.log"
layout="${longdate} | ${uppercase:${level}} | ${message}${onexception:${newline}EXCEPTION\: ${exception:format=ToString}}"
keepFileOpen="false" />
<target xsi:type="EventLog"
name="eventlog"
source="${appName}"
layout="${message}${newline}${exception:format=ToString}" />
</targets>
<rules>
<logger name="*" writeTo="default" minlevel="Info" />
<logger name="*" writeTo="debug" minlevel="Trace" maxlevel="Debug" />
<logger name="*" writeTo="eventlog" minlevel="Error" />
</rules>
</nlog>