JwtBearerDefaults is missing in Asp.Net Core 3.0 and 3.1
Today I upgraded my project in Asp.Net Core version 2.2 to 3.1. I have used JWT to authenticate but after change version Asp.Net Core to 3.1 I got a compile error The name 'JwtBearerDefaults' does not exist in the current context.
It's still working well in version 2.2. I don't know why? Please suggest to me if you have any solution.
Manish Kumar Nov 21 2020
I got the same issue. You have to install Microsoft.AspNetCore.Authentication.JwtBearer package to resolve your issue.
- Case 1: If you convert from version 2.2 to 3.0
Install-Package Microsoft.AspNetCore.Authentication.JwtBearer -Version 3.0.3
- Case 2: If you convert from version 2.2 to 3.1
Install-Package Microsoft.AspNetCore.Authentication.JwtBearer -Version 3.1.10
I hope it's helpful for you.