Asp.net mvc ';System.Web.HttpContext';不包含';GetOwinContext';

Asp.net mvc ';System.Web.HttpContext';不包含';GetOwinContext';,asp.net-mvc,owin,Asp.net Mvc,Owin,我有以下错误:'System.Web.HttpContext'不包含'GetOwinContext'的定义 每当我调试我的项目。此错误出现在web API页面中,尽管默认AcconController.cs中没有显示错误,并且安装了nuget软件包。缺少什么 using IdentitySample.Models; using System; using System.Collections.Generic; using System.Linq; using System.Net; using

我有以下错误:'System.Web.HttpContext'不包含'GetOwinContext'的定义 每当我调试我的项目。此错误出现在web API页面中,尽管默认AcconController.cs中没有显示错误,并且安装了nuget软件包。缺少什么

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;
        }
    }
使用IdentitySample.Models;
使用制度;
使用System.Collections.Generic;
使用System.Linq;
Net系统;
使用System.Net.Http;
使用System.Web.Http;
使用Microsoft.AspNet.Identity;
使用Microsoft.AspNet.Identity.Owin;
使用Microsoft.Owin.Security;
使用System.Web;
使用System.Threading.Tasks;
使用任务模型;
利用制度全球化;
公共应用程序管理员用户管理器
{
得到
{
返回_userManager??HttpContext.GetOwinContext().GetUserManager();
}
专用设备
{
_userManager=value;
}
}

好的,我找到了解决方案,因为我已经安装了nuget软件包。我需要做的是:

  return _userManager ?? HttpContext.**current**.GetOwinContext().GetUserManager<ApplicationUserManager>();
return\u userManager??HttpContext.*当前**.GetOwinContext().GetUserManager();

您安装了哪个Nuget软件包?
Microsoft.Owin.Host.SystemWeb
我缺少它的当前属性,有趣的是,我在Owin上找到的示例都有这样的问题