Reputation: 942
Creating simple method and seems like the 'cookieOptions' function are not working and Im getting stack on its reference prerequisites.
May I know what reference or module needs to be import to enable the capability of this
Here is the sample method:
public void SetCookie(string key, string value, int? expireTime)
{
CookieOptions option = new CookieOptions(); /// => Missing reference here
}
And here is the returning error:
'CookieOptions' could not be found (are you missing a using directive or an assembly reference?)
Any suggestions/comments TIA
Upvotes: 1
Views: 2923
Reputation: 26430
I'm assuming that you are using net core (nothing like this in .net framework)
Namespace:
Microsoft.AspNetCore.Http
Assembly:
Microsoft.AspNetCore.Http.Features.dll
Upvotes: 2
Reputation: 807
Assembly name Microsoft.AspNet.Http.CookieOptions for .net framework If you code .net core you can use this one Microsoft.AspNetCore.Http
Upvotes: 1