次のエラーが表示されます。
---------------------------
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
、ウィンドウ/ユーザーコントロールのプロパティが表示されます。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>