'The type or namespace name 'OpenIdConnectOptions' could not be found while upgrading my ASP.NET Core 2.2 to 3.1
I am trying to upgrade my ASP.NET Core 2.2 to 3.1 but getting below error. Not Sure how to resolve it.
I am getting below error
Severity Code Description Project File Line Suppression State Error CS0234 The type or namespace name 'OpenIdConnect' does not exist in the namespace 'Microsoft.AspNetCore.Authentication' (are you missing an assembly reference?)
Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'OpenIdConnectOptions' could not be found (are you missing a using directive or an assembly reference?)
Severity Code Description Project File Line Suppression State Error CS1061 'AuthenticationBuilder' does not contain a definition for 'AddOpenIdConnect' and no accessible extension method 'AddOpenIdConnect' accepting a first argument of type 'AuthenticationBuilder' could be found (are you missing a using directive or an assembly reference?)
Error CS0006 Metadata file 'C:....\bin\Debug\netcoreapp3.1\aa.dll' could not be found
I have this using directive in my solution.
using Microsoft.AspNetCore.Authentication.OpenIdConnect
Solution 1:[1]
run the following in your Package manager console
Install-Package Microsoft.AspNetCore.Authentication.OpenIdConnect -Version 6.0.4
For .Net 6
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Suraj Rao |