Search code examples
c#nlog

Nlog.config - read only


I installed Nlog from NuGet and tried to make some changes at NLog config. Unfortunately, that file is marked by a padlock. Also it is placed out of the project catalogue (C:\Users\username\.nuget\packages\nlog.config\4.7.13\contentFiles\any\any\NLog.config) and read-only. How should I correctly add that file to the project? Should I copy that and add it manually to the project?


Solution

  • The nlog config file should be carefully located so your resulting build project files load it correctly. In the documentation about the File Location info you see where the programs looks for the Nlog config file.

    You can indeed include it in your project and set the property Copy to Output directory to Copy if newer