J'ai mis à jour mon projet de Core 1.1 Core 2.0 en suivant les instructions de https://blogs.msdn.microsoft.com/webdev/2017/08/14/announcing-asp-net-core-2-0/ (cadre cible mis à jour .NET Core 2.0 et utilisé métapaquet Microsoft.AspNetCore.All) . J'ai également mis à jour tous les paquets de nuget possibles vers les dernières versions.méthode d'extension manquant AddJwtBearerAuthentication() pour IServiceCollection dans .NET Core 2.0
Dans .NET Core 1.1 i ajoutais JWT Bearer authentification de cette façon:
app.UseJwtBearerAuthentication(); // from Startup.Configure()
Comme par http://www.talkingdotnet.com/whats-new-in-asp-net-core-2-0/ Core 2.0 pour la nouvelle façon est d'appeler:
services.AddJwtBearerAuthentication(); // from Startup.ConfigureServices()
Mais la méthode AddJwtBearerAuthentication() est absent. Le package Microsoft.AspNetCore.Authentication.JwtBearer 2.0.0 est installé.
De nouveaux projets Core 2.0 vides (avec le package JwtBearer) n'ont pas non plus la méthode d'extension AddJwtBearerAuthentication() pour IServiceCollection.
L'ancienne méthode app.UseJwtBearerAuthentication() ne compile pas du tout:
Error CS0619 'JwtBearerAppBuilderExtensions.UseJwtBearerAuthentication(IApplicationBuilder, JwtBearerOptions)' is obsolete: 'See https://go.microsoft.com/fwlink/?linkid=845470'
S'il vous plaît aider.