"System.Web.HttpContext" does not contain a definition for "GetOwinContext"

I have the following error: "System.Web.HttpContext" does not contain a definition for "GetOwinContext" whenever I debug my project. this error is on the web API page, although it does not show an error in the standard AccounController.cs and the nuget package is installed. What is missing?

using IdentitySample.Models; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.Owin; using Microsoft.Owin.Security; using System.Web; using System.Threading.Tasks; using task.Models; using System.Globalization; public ApplicationUserManager UserManager { get { return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>(); } private set { _userManager = value; } } 
+7
asp.net-mvc owin
source share
1 answer

ok I found a solution, since I already installed the nuget package that I need to do is the following:

  return _userManager ?? HttpContext.**current**.GetOwinContext().GetUserManager<ApplicationUserManager>(); 
+7
source

All Articles