I have an ASP.NET Core 1.1 application that with code that uses this API:
Microsoft.AspNetCore.Identity.IdentityCookieOptions
When I attempt to upgrade to ASP.NET Core 2.0, the compiler gives me this error:
error CS0246: The type or namespace name 'IdentityCookieOptions' could not be found (are you missing a using directive or an assembly reference?)
What is the equivalent API in ASP.NET Core 2.0?
Fast: ASP.NET Core no longer depends on System. Web. dll for browser-server communication. ASP.NET Core allows us to include packages that we need for our application.
. Net Core does not support desktop application development and it rather focuses on the web, windows mobile, and windows store. . Net Framework is used for the development of both desktop and web applications as well as it supports windows forms and WPF applications.
This API was removed in this change: https://github.com/aspnet/Identity/pull/1188
In most cases, you most likely used the default value anyways. You can replace IdentityCookieOptions
with IdentityConstants
. If you had customized this value, you may need to find another way to flow your custom scheme names into the appropriate SignInManager calls (and anywhere else auth scheme is used).
Examples:
// old
IdentityCookieOptions.ApplicationScheme
IdentityCookieOptions.ApplicationCookieAuthenticationScheme
// new
IdentityConstants.ApplicationScheme
// old
IdentityCookieOptions.ExternalScheme
IdentityCookieOptions.ExternalCookieAuthenticationScheme
//new
IdentityConstants.ExternalScheme
//old
IdentityCookieOptions.TwoFactorRememberMeScheme
IdentityCookieOptions.TwoFactorRememberMeCookieAuthenticationScheme
//new
IdentityConstants.TwoFactorRememberMeScheme
//old
IdentityCookieOptions.TwoFactorUserIdScheme
IdentityCookieOptions.TwoFactorUserIdCookieAuthenticationScheme
//new
IdentityConstants.TwoFactorUserIdScheme
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With