Mahmoud Moravej
Mahmoud Moravej

Reputation: 9044

difference between Microsoft.Owin.Host.SystemWeb and Microsoft.AspNet.WebApi.WebHost nuget packages

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

Answers (1)

Luca Ghersi
Luca Ghersi

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

Related Questions