Andrew Truckle
Andrew Truckle

Reputation: 19087

How to fix deprecated nuget-package NLog.Config

Just noticed that in my list of Nuget packages, that "NLog.Config" is marked as deprecated:

enter image description here

Is it safe to simply delete the package?

This particular application is for Google Calendar API usage.


I should have looked more closely at my code. I removed the package and now my tool won't compile. I have code like:

Imports NLog
Private m_logger As NLog.Logger = LogManager.GetCurrentClassLogger()

And 10 instances of calls like:

m_logger.Error(ex, "RESULT_FAILED_OAUTH")

How to resolve now that NLog is deprecated?

Upvotes: 3

Views: 2093

Answers (1)

Rolf Kristensen
Rolf Kristensen

Reputation: 19847

NLog.config-nuget-package is safe to remove, and one is encouraged to remove it. It became obsolete when Microsoft introduced <packagereference>-syntax.

Now the NLog.config-nuget-package actually causes issues because it can reset the NLog.config-file on application-publish (Same story can also seen on the nuget-package-page)

Just replace it with NLog-nuget-package, if you don't have it installed already.

Upvotes: 4

Related Questions