I did some consolidation of my NuGet packages across my solution and now I'm receiving:
exception message:
MissingMethodException: Method not found: 'System.IDisposable Serilog.Context.LogContext.Push(Serilog.Core.ILogEventEnricher)'.
call stack on the exception:
at Serilog.Extensions.Logging.SerilogLoggerProvider.BeginScope[T](T state) at Microsoft.Extensions.Logging.Logger.BeginScope[TState](TState state)
when I make a call like this:
using (logger.BeginScope(new Dictionary<string, object>
{
["SomeProperty"] = someVariable,
}))
{
logger.LogInfo("hello world");
}
package.config
<package id="Microsoft.Extensions.Logging" version="2.1.1" targetFramework="net48" />
<package id="Serilog" version="2.10.0" targetFramework="net48" />
<package id="Serilog.Extensions.Logging" version="3.0.1" targetFramework="net48" />
It would seem I have an incorrect NuGet reference but I'm not seeing it.
I also put together a full repro of the problem here.