NLog in .NET 4.5 console app: not loading Configuration
12:21 18 Aug 2016

I have some console apps I've written at work. I'd like to get NLog into them but I am having trouble. When I inspect the 'logger' object, I see in it's 'Factory' property, that the configuration had targets=0, loggingrules=0, everything blank or unset. So, it doesn't do ANYTHING.. doesn't drop an internal log file either... I have tried nLog.config NLog.config and nlog.config... to no avail. Tried ver 3 and 4 of NLog too...

Why would it not pick up the config?

I have:

  • NLog.config in the root with 'Content' for build action and 'Copy Always' set
  • Confirmed the NLog.config IS being copied to the bin screenshot1

Here's the NLog.config:



  
    
    
  
  
    
        
  

and finally (this doesn't error, but nothing is output since the config is blank):

private static Logger logger = LogManager.GetCurrentClassLogger();
logger.Info("ConsoleApp test log...");
c# console-application nlog