V
V
Vlad2021-10-07 15:04:08
ASP.NET
Vlad, 2021-10-07 15:04:08

Problem with Microsoft.Extensions.Logging older than version 6.0.0-preview6.*?

After connecting to the web application template project of the Microsoft.Extensions.Logging package older than version 6.0.0-preview6.* or newer 6.0.0-rc.*, it fails with an exception

MissingMethodException: Method not found: 'System.Action`4<Microsoft.Extensions.Logging.ILogger,!!0,!!1,System.Exception> Microsoft.Extensions.Logging.LoggerMessage.Define(Microsoft.Extensions.Logging.LogLevel, Microsoft.Extensions.Logging.EventId, System.String, Boolean)'.


crashes somewhere inside the call to IEndpointRouteBuilder.MapControllers

Has anyone already encountered this problem? How to solve it (of course, except for downgrading to the old version)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-10-07
@vabka

1. If Trimming is enabled, it can simply cut the method.
2. This is a Preview.
show csproj

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question