Relationship between Webapi, Webhost and Owin

前端 未结 1 1614
广开言路
广开言路 2020-12-23 11:35

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 corr

1条回答
  •  独厮守ぢ
    2020-12-23 12:14

    Your understanding is generally correct, but the role of OWIN seems misunderstood. A more complete timeline would be:

    1. OWIN Standard developed to describe generic .NET web interface, a la WSGI/Rake/Connect (first commit in 2010).
    2. ASP.NET WebAPI is developed host-independent, but released with https://www.nuget.org/packages/Microsoft.AspNet.WebApi.WebHost/.
    3. Katana Project implements several OWIN hosts:
      1. https://www.nuget.org/packages/Microsoft.Owin.SelfHost/
      2. https://www.nuget.org/packages/Microsoft.Owin.Host.HttpListener/
      3. https://www.nuget.org/packages/Microsoft.Owin.Host.IIS/
      4. https://www.nuget.org/packages/Microsoft.Owin.Host.SystemWeb/
    4. ASP.NET WebAPI adapter for OWIN is released: https://www.nuget.org/packages/Microsoft.AspNet.WebApi.Owin.

    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.

    0 讨论(0)
提交回复
热议问题