Reputation: 9044
I want to host my WebApi
project in IIS
and Self-Host context. In my researches, For IIS
hosting, I found these two packages:
1- Microsoft.AspNet.WebApi.WebHost (src)
This package contains everything you need to host ASP.NET Web API on IIS
2- Microsoft.Owin.Host.SystemWeb (src)
OWIN server that enables OWIN-based applications to run on IIS using the ASP.NET request pipeline.
My WebApi
app can be loaded in IIS with both of them. So the question is what is the difference between these two packages and in which condition I should use them.
P.S. I get some error when hosting with second package in some scenarios.
Upvotes: 3
Views: 2235
Reputation: 3321
This package Microsoft.Owin.Host.SystemWeb is required if you want to host Web.API on a OWIN pipeline and you are hosting this pipeline on IIS (you don't need this for self-hosting, for example inside a console app).
The other one is required for "classic" Web.API hosting and has nothing to do with OWIN itself.
I guess you want to run OWIN (because you're self hosting too), so you need the second one.
BTW, the OWIN equivalent of Microsoft.AspNet.WebApi.WebHost is Microsoft.AspNet.WebApi.Owin.
Upvotes: 2