asp.net Web API自托管/owin/武士刀 [英] asp.net web api self hosting / owin / katana

查看:110
本文介绍了asp.net Web API自托管/owin/武士刀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于自托管,我有多个问题

There are multiple question I have around self-hosting

自托管Nuget

有2个提供自托管功能的nuget:Microsoft.AspNet.WebApi.OwinSelfHostMicrosoft.AspNet.WebApi.SelfHost,因此Microsoft是否有2个自托管实现?还是一样?

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或Kitana

nuget的名称是Microsoft.AspNet.WebApi.OwinSelfHost,具有OWIN,但据我所知,Owi​​n是一个接口,而Kitana是一个实现,实现的nuget的名称是什么?

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??

在生产中托管

我设法通过创建一个控制台来运行该示例.但是当部署到产品时,如何部署?运行exe并保持控制台运行,不能这样做.如果有人关闭该控制台该怎么办.所以应该作为Windows服务的一部分托管?或还有其他方法吗?

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?

推荐答案

NuGet包

NuGet package here clearly states this.

Microsoft ASP.NET Web API 2.2自助主机5.2.2这是旧版软件包 用于在您自己的进程(IIS外部)中托管ASP.NET Web API. 请为新版本使用Microsoft.AspNet.WebApi.OwinSelfHost程序包 项目.

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.

无论如何,SelfHost很旧,并且基于WCF堆栈. OwinSelfHost是新的,基于Katana(名称为Katana,而不是Kitana,BTW).

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).

对于生产托管,控制台应用程序不实用.您将需要创建Windows服务.看看.

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

这篇关于asp.net Web API自托管/owin/武士刀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆