Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Microsoft.Owin.Host.SystemWeb and Microsoft.Owin.Host.IIS

Tags:

.net

asp.net

iis

As I know Microsoft.Owin.Host.SystemWeb allows me to run OWIN app on IIS, but today I found another package called Microsoft.Owin.Host.IIS that (as I understand from it's name) has similar purpose.

Actually I think that I am wrong and that packages are very different.

So, here the questions:

  • What is the difference between that two packages?
  • In what case should I use one or another?
  • And last (optional): can someone give me a link to good explanation of all that ASP.NET 5 mess? (Microsoft creates new platforms/frameworks/features faster than document them, so I am feeling quite disoriented now...)
like image 844
rtf_leg Avatar asked Jan 08 '23 07:01

rtf_leg


2 Answers

To answer your optional question:

The problem with System.Web is that it is way too bloated and coupled with IIS. As an example, you cannot host an MVC website in a Console Window. You are forced to run it in IIS. The OWIN initiative is an attempt to modularize and decouple the Web Stack by adding abstraction.

In essence, the entire Web Stack is reduced to a pipeline of middleware components (similar to the way node.js does things). A middleware component or AppFunc (Func<IDictionary<string, object>,Task>) is a function that takes a context (containing request, response and other things...) and does something with it (request parsing, routing, rendering a view, logging stuff, ...). The entire stack then becomes a sequence of middleware components: every component calls the next one in the chain, or breaks execution by not calling the next one.

ASP.NET 5 is a natural evolution in the sense that it builds upon OWIN and as such enables modularity and removes the dependency on System.Web (and IIS). Everything is now opt-in and you can even run applications cross-platform (using .NET Core). This would never be possible without OWIN.

like image 123
mstaessen Avatar answered Jan 15 '23 23:01

mstaessen


Microsoft creates new platforms/frameworks/features faster than document them

The concurrent development of MVC 6, Katana (OWIN) and ASP.NET 6 isn't really helping to clear the confusion between all that's going on.

As far as I understand it:

The Microsoft.Owin.Host.IIS namespace, assembly and package are for Helios, introduced in this blog post. Basically it's meant to run managed code, without ASP.NET, in IIS - to provide your own OWIN middleware on top of that.

So you seem to need Microsoft.Owin.Host.SystemWeb for your purposes. This forms an OWIN host that allows your middleware to use System.Web.

like image 44
CodeCaster Avatar answered Jan 15 '23 23:01

CodeCaster