Why is that a call to IWebHostBuilder.Configure()
extension method seemingly doesn't do anything in ASP.NET Core (experienced in version 3.4.0)?
For example in this scenario:
public static IHostBuilder CreateHostBuilder(string[] args)
=> Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => {
webBuilder
.UseSerilog( ... )
.Configure(appBuilder => // Doesn't do anything.
appBuilder.UseSerilogRequestLogging( ... ))
.UseStartup<Startup>();
});
Here, UseSerilogRequestLogging()
is called inside Configure()
to add Serilog's request logging middleware before Startup executes, in order to place it at the beginning of the request pipeline, and also to keep logging-related configuration at one place.
But Configure()
literally doesn't do anything, and the middleware is not added.