Hi, Kim,
Unfortunately, I have now had to remove NLog from my main project, because I just couldn't spend any more time trying to get it working.
I tried creating a new
ASP.NET website, and added NLog to it. This worked when I had the project configured to debug on the inbuilt IIS server, but failed when I tried to get it to run on my full local IIS, so I am guessing that there is some kind of a permissions problem or some other configuration issue in IIS. My main problem is that I can't debug this because even when I set internalLogToConsole="true" throwExceptions="true" in NLog, it still fails silently.
Only when I get the debugger to stop on all exceptions can I get some kind of idea what is failing. Doing this, I have just tried to stop on all thrown exceptions in the new project and I get the debugger stopping to ask the location of the following file: c:\NLogBuild\src\NLog\Internal\FileAppenders\BaseFileAppender.cs. If I get the debugger to continue, I do indeed get an UnauthorizedAccessException in BaseFileAppender.CreateWindowsFile. I don't understand this, though, because I have full Administrator privileges in the directory and Visual Studio is running as Administrator. I can fix this by adding IIS_IUSRS and giving this group full control. Guess I can do this and simply pray that, when I deploy to the live server, I don't get the same problems.
In summary, I am sure the problem is caused by my lack of IIS knowledge, and not NLog, though it is disappointing that I can't get error information out of NLog without using the debugger in 'big hammer' mode.
Thank you for looking at this for me.
Kind wishes ~ Patrick