XML Config not working

2 messages Options
Embed this post
Permalink
cid

XML Config not working

Reply Threaded More More options
Print post
Permalink
Hello,

my App.config is somehow not working

        <?xml version="1.0" encoding="utf-8" ?>
<configuration>
        <appSettings>
                <!-- TELNET CONFIG -->
                               
                <!-- OPC CONFIG -->
               
               
                <!-- APPLIKATION CONFIG -->
               
        </appSettings>
       
        <!-- NLOG -->
        <configSections>
                <section name="nlog" type="Nlog.Config.ConfigSectionHandler, NLog"/>
        </configSections>
       
        <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

                <targets>
                        <target name="file01" xsi:type="File" fileName="C:\logBikeTower.txt" layout="${longdate} ${callsite} ${level} ${message}" />
                </targets>
               
                <rules>
                        <logger name="*" minilevel="Debug"  writeTo="file01" />
                </rules>

        </nlog>

       
</configuration>
I downloaded and installed nlog-1.0-setup.
I added the Reference NLog.dll to my project.

I got
- Visiual Studio 2008
- .Net Framework 3.5
- Language: C#
Jaroslaw Kowalski

Re: XML Config not working

Reply Threaded More More options
Print post
Permalink
I think that <configSections> has to be the first entry in your config file. Other than that the config looks to have a typo: use "minlevel" instead of "minilevel".

Also check that you have write permissions to the file.