I have a class library and I fixed the same issue by installing the Microsoft.AspNetCore.Authentication.JwtBearer v9.0.0