问题
I am working on a .net core project which uses a nuget package say NUGET 1. The package references serilog for logging purpose. Everything works fine till here. The references of serilog can be seen in the image.
As soon as I add another nuget package say NUGET 2. The project still builds but this time I get a runtime error below.
Method not found: 'Serilog.LoggerConfiguration Serilog.LoggerConfigurationLogentriesExtensions.Logentries(Serilog.Configuration.LoggerSinkConfiguration, System.String, Boolean, Int32, System.Nullable`1, Serilog.Events.LogEventLevel, System.String, System.IFormatProvider)'.
The details of second nuget package are in image below. I am unable to figure out exact reason for this.
回答1:
This was due to difference in version of serilog
in both nuget packages. I updated the second nuget package to point to same version of serilog
. This fixed the issue for me.
The similar problem is also described here Method not found: 'Serilog.LoggerConfiguration and the solution for this is also the same.
来源:https://stackoverflow.com/questions/58086137/method-not-found-serilog-loggerconfiguration-serilog-loggerconfigurationlogent