The GetOwinContext extension GetOwinContext is located in the System.Web.Http.Owin dll, which must be loaded as the nuget package (the nuget package name is Microsoft.AspNet.WebApi.Owin)
Install-Package Microsoft.AspNet.WebApi.Owin
See here msdn: http://msdn.microsoft.com/en-us/library/system.net.http.owinhttprequestmessageextensions.getowincontext(v=vs.118).aspx
Nuget package here: https://www.nuget.org/packages/Microsoft.AspNet.WebApi.Owin
However, this method is still part of the System.Net.Http namespace, so the using definitions you have must be exact.
EDIT
Good to eliminate some confusion: if you are using ApiController ( MyController : ApiController ), you will need the Microsoft.AspNet.WebApi.Owin package.
If you are using a regular Mvc controller (i.e. MyController : Controller ), you will need the Microsoft.Owin.Host.SystemWeb package.
In MVC 5, the pipelines for Api and regular MVC were very different, but often had the same naming convention. Therefore, the extension method in one does not apply to the other. The same goes for many action filters, etc.
Simon C Mar 24 '14 at 0:09 2014-03-24 00:09
source share