I'm just trying to get my head around relationship between webapi, webhost (iis) and owin. I'll write down my current understanding, and I ask you to tell me if it is correct or not.
Microsoft.Owin.Host.SystemWeb
, Microsoft.AspNet.WebApi.WebHost
) is a layer to between a higher level API (such as Webapi) and the IIS. Since Webapi initially was host independent, an intermediate layer required to make it run on a particular host, such as IIS. Webhost for Webapi (Microsoft.AspNet.WebApi.WebHost
) provided this layer. Later on there will also be Webhost layer for Owin (Microsoft.Owin.Host.SystemWeb
), that would allow hosting anything Owin compatible on IIS.Microsoft.Owin.Host.SystemWeb
) (similar to how Webapi came with Webhost) that allowed Owin apps to be hosted on IIS. It also came with self-host (Microsoft.Owin.SelfHost
) that allowed Owin apps to be hosted inside any executable. As far as Webapi concerned, Owin also came with Owin host for Webapi (Microsoft.AspNet.WebApi.Owin
) which allowed running WebApi on Owin stack.All the above means that one has two different ways of hosting Webapi on IIS. It can be done without Owin, using Webapi WebHost, or it can be done with Owin Host for Webapi and with Webhost for Owin.
Nuget references:
Is this understanding correct?
Your understanding is generally correct, but the role of OWIN seems misunderstood. A more complete timeline would be:
Your summary:
All the above means that one has two different ways of hosting Webapi on IIS. It can be done without Owin, using Webapi WebHost, or it can be done with Owin Host for Webapi and with Webhost for Owin.
I would restate that as:
All the above means that one has two different ways of hosting WebAPI. It can be done without Owin, using WebAPI WebHost, or it can be done with the OWIN adapter for WebAPI and any OWIN-compatible host. Hosting options on IIS are Microsoft.Owin.Host.IIS and Microsoft.Owin.Host.SystemWeb. Microsoft.AspNet.WebApi.OwinSelfHost is also provided.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With