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\文件夹存在于硬盘上,但我不认为它是问题的根源
但是什么呢?
发布于 2015-10-14 06:19:57
改变value="D:\Internal\Logs\"
至:
value="D:/Internal/Logs/"
和
fileName="${TargetDirectory}${TraceLogname}
至:
fileName="${TargetDirectory}/${TraceLogname}
https://stackoverflow.com/questions/33084759
复制相似问题