App.config问题

时间:2013-01-21 09:17:30

标签: configuration web-config app-config

当我修改我的app.config以包含ReflectSoftware日志记录信息时,Ninjatrader崩溃了。你能指出我没有正确配置的地方吗?

?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.net>
        <defaultProxy>
            <proxy usesystemdefault="False"/>
        </defaultProxy>
    </system.net>
    <configSections>         
   <section name="insightSettings" type="ReflectSoftware.Insight.ConfigurationHandler,ReflectSoftware.Insight"/>
</configSections> 
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <!--
    In order to recieve location information, you must ensure the layout has the parameter ${callsite} and all 
    its properties set accordantly.
     -->
    <extensions>
        <add assembly="ReflectSoftware.Insight.Extensions.NLog"/>
    </extensions>
    <targets>
      <target name="ReflectInsight"
              xsi:type="ReflectInsight"
              instanceName="nlogInstance1"
              displayLevel="true"
              displayLocation="true"
              layout="${callsite:className=true:fileName=true:includeSourcePath=true:methodName=true}" />
    </targets>
    <rules>
        <logger name="*" minlevel="Trace" writeTo="ReflectInsight" />        
    </rules>
</nlog>
</configuration>

1 个答案:

答案 0 :(得分:2)

通过在Config sections

之后移动xml片段来修复