NLog upgrade issue

37 Views Asked by At

I have a micro service nad using Nlog, I upgraded my Nlog (NLog.Web.AspNetCore) from 4.8.5 to 5.3.8, and run my micro service, I am getting this error: System.MissingMethodException: 'Method not found: 'System.Collections.Generic.IDictionary`2<System.String,NLog.Layouts.SimpleLayout> NLog.Config.LoggingConfiguration.get_Variables()'.', any ideas?

Build is fine, but could not run the webhost.

1

There are 1 best solutions below

0
Rolf Kristensen On

NLog v5 contains several breaking changes. One of them is changing NLog Configuration Variables to support any Layout (Ex. JsonLayout instead only SimpleLayout).

You should look at the StackTrace from the System.MissingMethodException, and use it to pin-point the project that needs explicit upgrade to NLog v5.