user1324887
user1324887

Reputation: 672

AspNetCore.Http 'HttpRequest' does not contain a definition for 'GetOwinContext'

we are using AspNetCore.Http with MyController : Controller. How do I get Get OwinContext this.Request.GetOwinContext(); doesnt work.

'HttpRequest' does not contain a definition for 'GetOwinContext' and the best extension method overload 'OwinHttpRequestMessageExtensions.GetOwinContext(HttpRequestMessage)' requires a receiver of type 'HttpRequestMessage'

Upvotes: 0

Views: 1640

Answers (1)

Michael Wang
Michael Wang

Reputation: 4022

ASP.NET Core:

OWIN allows web apps to be decoupled from web servers. It defines a standard way for middleware to be used in a pipeline to handle requests and associated responses. ASP.NET Core applications and middleware can interoperate with OWIN-based applications, servers, and middleware.

OWIN provides a decoupling layer that allows two frameworks with disparate object models to be used together.

enter image description here

The Microsoft.AspNetCore.Owin package provides two adapter implementations:

  • ASP.NET Core to OWIN
  • OWIN to ASP.NET Core

This allows ASP.NET Core to be hosted on top of an OWIN compatible server/host or for other OWIN compatible components to be run on top of ASP.NET Core.


Note:

Using these adapters comes with a performance cost. Apps using only ASP.NET Core components shouldn't use the Microsoft.AspNetCore.Owin package or adapters.

Upvotes: 1

Related Questions