Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Fix ASP.NET Core deprecated package

$
0
0

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:

transitive package

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();    ...}

Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>