Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F# NLog config file

Tags:

config

f#

nlog

xsd

I'm trying to use NLog in an F# console application, I've managed to get it working using a configuration section in App.config however I can't get it working using a stand-alone NLog.config file. My NLog.config file is in the app route, just under App.config and the contents are:

<?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" throwExceptions="true">
    <targets>
        <target name="stdFile" xsi:type="File" fileName="c:/temp/compliant.log"/>
        <target name="display" xsi:type="OutputDebugString"/>
    </targets>
    <rules>
        <logger name="compliant.mail.*" minlevel="Debug" writeTo="stdFile,display" />
    </rules>
</nlog>

What am I doing wrong?

Also, intellisense isn't working for the xml even though I have included the xsd. :(

like image 591
shmish111 Avatar asked Dec 07 '12 20:12

shmish111


1 Answers

In your project, in the Properties for NLog.config, do you have NLog.config marked as "Copy Always"?

like image 112
wageoghe Avatar answered Oct 17 '22 18:10

wageoghe