What is the reference to Httpcontext.Getowincontext() ?

Asked

Viewed 2,349 times

4

I had to abstract the Controllers of an application ASP.NET MVC for a Class Library because I’m using different technologies in the same application.

However, I have the error:

'System.Web.Httpcontextbase' does not contain a Definition for 'Current' and no Extension method 'Current' Accepting a first argument of type 'System.Web.Httpcontextbase' could be found (are you Missing a using Directive or an Assembly Reference?)

inserir a descrição da imagem aqui

I already installed the System.Web.Mvc and System.Web

using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using Microsoft.Owin.Security;
using Modularizacao.Comum.App_Start;

But it did not solve this dependency. What is missing to reference to avoid this error ?

1 answer

10


None.

HttpContext.GetOwinContext() is an extension method in System.Net.Http.

Possibly missing the bundle Microsoft.Owin.Host.Systemweb, it contains that extension.

PM> Install-Package Microsoft.Owin.Host.Systemweb

  • Thanks, Works fine!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.