I have downloaded and installed the latest version of NLog and tried the sample project on the NLog documentation (in the introduction page), but no output appears on the console.
I am using Visual Studio 2010 and the project configuration is for .net 4.0.
And if I change the target framework to 2.0, again nothing happens.
Here is the code:
public class Program
private static Logger logger = NLog.LogManager.GetCurrentClassLogger();
static void Main(string args)
and the NLog.config file:
<?xml version="1.0" encoding="utf-8" ?>
I have a unit test project in my console solution. In the console project, it NLog works just fine and writes log messages nicely into a file "log.txt", but in my unit test project, it refuses to write log messages to file. The NLog.config file in the console project and the NLog.config file in the unit test project are completely the same.
I had a such problem. Solved by changing NUnit settings as follows:
Default Process Model=Run tests in a single separate process
Default Domain Usage=Use a separate process per Assembly
And yes, NLog.config file should be placed in the same folder with tested assembly.