1

NLog has been a great tool so far, and I'm not sure how this problem hasn't popped up earlier. The issue is this. I have 2 similar, but unique projects which I'm working on side by side. (Different projects on different folders, both using Studio '19) Each has NLog added to the project. My problem is this. Somehow NLog.config for BOTH projects is the SAME config file. Thus, when I change the path for logging, BOTH applications are affected. Obviously, NOT a solution. I'm still checking the internet, but so far, I can't see how you change the NLog.config path to anything other that that assigned upon install, which, BTW, is this path here, specified as "Full Path" in the NLog.config's properties: "C:\Users\.nuget\packages\nlog.config\4.6.8\contentFiles\any\any\NLog.config"

Question: How do I specify a unique NLog.config for each project?

jdosser
  • 143
  • 1
  • 7
  • Are you by any chance using the NLog.config nuget-package: https://www.nuget.org/packages/NLog.config ? Anyway your issue sound really strange and very unique :) – Rolf Kristensen Mar 31 '20 at 20:55
  • Yes, I'm adding the NLog features through Tools->NuGet Package Manager. I'm loading the following Nlog Packages: NLog, NLog.Config, NLog.Schema. It appears the schema is shared as well. I'm wondering if having both Studio sessions open at the same time is the problem.I can Deploy first one project then the other, making NLog.Config file changes prior to each Deployment. In this case, it appears the NLog.Config is unique to whichever project last updated the file. That seems an issue to me. It would be nice to have an NLog.Config dedicated to the project and not shared among projects. – jdosser Mar 31 '20 at 21:52
  • 1
    The nuget-package `NLog.config` is pretty much a knife in your eye, instead of a helping hand. See also here: https://github.com/nlog/nlog/wiki/NLog-Install . Microsoft decided to simplify the nuget-package-framework, and it caused a lot of nuget-packages to become broken. Including: https://www.nuget.org/packages/NLog.config (Advice stop using it) – Rolf Kristensen Mar 31 '20 at 21:57
  • I'm using NLog version is 4.7.9 through NuGet package. BTW, what do you use instead of NLog? – jdosser May 19 '21 at 18:56
  • I'm also using `NLog`-nuget-package. Just saying you should stay from the `NLog.config`-nuget-package. – Rolf Kristensen May 19 '21 at 19:30

0 Answers0