asp.net web api self hosting / owin / katana

喜你入骨 提交于 2019-12-22 03:49:03

问题


There are multiple question I have around self-hosting

Self Hosting Nuget

There are 2 nuget which provide self hosting : Microsoft.AspNet.WebApi.OwinSelfHost and Microsoft.AspNet.WebApi.SelfHost, so does microsoft have 2 implementation of self hosting?? or they are same??

Owin or Kitana

the name of nuget is Microsoft.AspNet.WebApi.OwinSelfHost has OWIN, but as far as I read Owin is an interface and Kitana an implementation, what is the name of the nuget for implementation??

Hosting in Production

I have managed to run the example by creating a console. But when deploying to prod, how to deploy?? Run the exe and keep running console, cant do that. what if somebody closes that console. So should be hosted as part of windows service?? or Is there any other way?


回答1:


NuGet package here clearly states this.

Microsoft ASP.NET Web API 2.2 Self Host 5.2.2 This is a legacy package for hosting ASP.NET Web API within your own process (outside of IIS). Please use the Microsoft.AspNet.WebApi.OwinSelfHost package for new projects.

Anyways, SelfHost is old and is based on WCF stack. OwinSelfHost is new and is based on Katana (name is Katana and not Kitana, BTW).

For production hosting, console app is not practical. You will need to create a Windows service. Take a look at this.




回答2:


after working on months with webapi/owin I got answers to above questions..

The package to use

Microsoft.AspNet.WebApi.OwinSelfHost

and for hosting better to use topshelf

Topshelf

please read this blog post



来源:https://stackoverflow.com/questions/26882806/asp-net-web-api-self-hosting-owin-katana

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!