Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# NLog不';t从XML配置加载规则_C#_Logging_Nlog - Fatal编程技术网

C# NLog不';t从XML配置加载规则

C# NLog不';t从XML配置加载规则,c#,logging,nlog,C#,Logging,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"> <

配置文件(变量除外)包含以下数据:

<?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">

  <extensions>
    <add assembly="NLog.Extended" />
  </extensions>

  <targets async="True">
    <target name="TraceLogger"
            type="File"
            fileName="${TraceFullPath}"
            archiveFileName="${TraceArchiveFullPath}"
            maxArchiveFiles="100"
            archiveNumbering="Sequence"
            archiveEvery="None"
            layout="${message}" />
  </targets>

  <rules>
    <logger name="*"
            minLevel="Trace"
            writeTo="TraceLogger"
            enabled="True" />
  </rules>
</nlog>
调试器显示以下对象的下一个属性值:

configuration.base.LogginRules: Count = 0
configuration.base.AllTargets: Count = 0
logger.Is...Enabled = false (for all levels)

知道我做错了什么吗?

问题很简单:变量和目标值的大小写错误


很抱歉占用了您的时间

请尝试将
ThroweExceptions
设置为
true
。您的.config可能有问题。不幸的是,不是:(.我在谷歌上搜索了NLog疑难解答,并完成了查找错误的步骤,logger开始完美工作,甚至我对变量和目标的更改也是如此
configuration.base.LogginRules: Count = 0
configuration.base.AllTargets: Count = 0
logger.Is...Enabled = false (for all levels)