Closed nmklotas closed 7 years ago
is your NLog config in nlog.config?
Could you try with <nlog throwConfigExceptions="false">
?
Hi,
I don't have any NLog configuration file. Should I have one?
No perse, so the nlog config is in the appSettings? Or there isn't a log config at all?
There is no nlog config at all. I deleted it long time ago.
I see. One fix is to disable throwing of config exception, I think a work around would be to set a new config before getting the logger:
LogManager.Configuration= new LoggingConfiguration();// before all GetCurrentClassLogger
LogManager.GetCurrentClassLogger();
I am experiencing this problem ever since I added an app.config to my solution.
When trying the suggested solution above, I get: System.TypeInitializationException: 'The type initializer for 'Nlog.Common.InternalLogger' threw an exception.' 2 of 2 Inner Exceptions ConfigurationErrorsException: Unrecognized attribute 'xmlns:xdt'. Note that attribute names are case sensitive.
We are using transforms in our builds so using the transforms with an app.config is new, too. It is a requirement of my organization. I may have to get rid of NLog.
Please open a new issue, fill in the template and reference to this one, thanks!
Hello, I have an issue with invalid appsettings file and NLog.
NLog version: (e.g. 4.3.10)
Platform: ..Net 4.5 Current NLog config No config file is used
NLog method:
throws exception.
NLog does not use applications settings file, and I as a developer can handle App failure if user.config is not valid when accessing application settings.