Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 835
Andrew Truckle Avatar asked Dec 06 '25 04:12

Andrew Truckle


1 Answers

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.

like image 125
Rolf Kristensen Avatar answered Dec 11 '25 05:12

Rolf Kristensen