I have a Mend Bolt warning because of this old version for encodings.web: system.text.encodings.web.4.5.0.nupkg
. Version 4.5.0 has security vulnerabilities. I need to upgrade to a higher version.
It is added as a transitive package from Microsoft.AspNetCore.Hosting.Abstractions
:
The problem is version 2.2.0 for Microsoft.AspNetCore.Hosting.Abstractions
is deprecated.
My project uses .NET 6. I cannot find that package in a newer format or another variant. I use Hosting.Abstractions
for IWebHost
class, for a migration extension method. If I uninstall it, then the warning is solved but my method does not build.
public static IWebHost MigrateDbContext<TContext>(this IWebHost webHost, Action<TContext, IServiceProvider> seeder) where TContext : DbContext{ var services = scope.ServiceProvider; var logger = services.GetRequiredService<ILogger<TContext>>(); var context = services.GetService<TContext>(); ... context.Database.Migrate(); ...}