【发布时间】:2015-10-12 15:25:18
【问题描述】:
NLog 在尝试创建记录器时抛出异常:
var configuration = new XmlLoggingConfiguration(configurationPath);
Exception message: LayoutRenderer cannot be found: 'TargetDirectory'
记录器配置:
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<extensions>
<add assembly="NLog.Extended" />
</extensions>
<variables>
<variable name="TargetDirectory"
value="D:\Internal\Logs\" />
...
<targets>
<target name="TraceLog"
xsi:type="File"
fileName="${TargetDirectory}${TraceLogname}"
...
</nlog>
NLog.Extended.dll 出现在bin 文件夹中D:\Internal\Logs\ 文件夹存在于 HDD 上,但我认为这不是问题的根源
但是什么?
【问题讨论】:
标签: nlog