Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrating from OWIN to ASP.NET Core

When moving from OWIN to ASP.NET Core, I've found a bit of information about dependencies to migration, but I've not found information about these other topics:

  • The middle-ware pipeline. How is this different, or not?
  • The DelegatingHandler pipeline (e.g. Web API). How is this different, or not?
  • The startup.cs file. How is this different?

In short, it would be great to know what are the primary hot-spots that would need my attention, in order to move from OWIN to ASP.NET Core.

As a first example - ASP.NET Core does not appear to have HttpConfiguration. There are myriads of example plugins and services that assume its existence. I'd like to infer how to translate instructions for HttpConfiguration into whatever approach ASP.NET Core expects.

As another example, the Swashbuckle documentation gives instructions for setup with OWIN, but those instructions don't work with ASP.NET Core. If I understood the primary differences from OWIN, it would be easier to "guesstimate" how to install Swashbuckle into ASP.NET Core.

  • Note: Swashbuckle also gives instructions for self-hosted apps. That confuses me because I think of OWIN (vis-a-vis Katana) as being self-hosted already, and so it sounds redundant to me. But I don't think this is related to the present question.

My question has used Swashbuckle as an example, but I am not asking about Swashbuckle specifically.

Update

I've discovered that much of the information I'm looking for is in the article Transitioning from Web API 2 to ASP.NET MVC 6.

like image 994
Brent Arias Avatar asked Mar 14 '16 20:03

Brent Arias


People also ask

Is OWIN supported in .NET core?

ASP.NET Core: Supports the Open Web Interface for . NET (OWIN).

How do I migrate to .NET core?

You can migrate your old project to the Core project using the 'dotnet migrate; command, which migrates the project. json and any other files that are required by the web application. The dotnet migrate command will not change your code in any way.

Is OWIN deprecated?

Owin 5.0. 0. This package has been deprecated as it is legacy and is no longer maintained.


2 Answers

  • Middleware is quite similar between Katana and Core but you use HttpContext instead of IOwinContext.
  • Startup.cs is similar but there's much more DI support.
  • WebApi has been merged into MVC
  • DelegatingHandler is gone, use middleware instead.
  • HttpConfiguration has been split up into Routing and MvcOptions.

Also https://devblogs.microsoft.com/aspnet/katana-asp-net-5-and-bridging-the-gap/

like image 79
Tratcher Avatar answered Oct 11 '22 03:10

Tratcher


I think you can start here. It's an entire chapter about OWIN with ASP.NET Core. Hope this helps.

like image 45
Danny van der Kraan Avatar answered Oct 11 '22 03:10

Danny van der Kraan