ASP.NET vNext是主机无关,这是什么意思深? [英] ASP.NET vNext is host agnostic, what does it deeply mean?

查看:133
本文介绍了ASP.NET vNext是主机无关,这是什么意思深?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据<一个href=\"http://www.asp.net/vnext/overview/aspnet-vnext/getting-started-with-aspnet-vnext-and-visual-studio\">ASP.NET vNext教程: vNext是主机无关。您可以承载您的应用程序在IIS中,或自主机的自定义过程

任何人都可以帮助我在走向深沉理解这种与显示当前asp.net主机和新的区别?

Could anyone help me to understand this in deepth with showing the difference between current asp.net host and new one?

推荐答案

早在2002年,有基本上的.NET平台一台Web服务器,那就是IIS。几年后,在Visual Studio开发Web服务器(卡西尼号,其前身为原网站矩阵的一部分)来了作为一个唯一的DEV-服务器。但所有这些最终使用的System.Web作为应用程序和web服务器之间的托管层。对System.Web主机是紧耦合的IIS和是非常困难的其他主机上运行。即使VS开发Web服务器上的实现是有限的,因为它仅支持某些功能。所以,正因为如此,仍有只是一个产品质量的主机为依靠的System.Web典型的ASP.NET应用程序。

The history of ASP.NET hosting

Back in 2002, there was basically one web server for the .NET platform, and that was IIS. A few years later the Visual Studio Development Web Server ("Cassini", formerly part of the original Web Matrix) came along as a dev-only server. But these all ultimately used System.Web as the hosting layer between the application and the web server. The System.Web host is tightly coupled to IIS and is very difficult to run on other hosts. Even the implementation on the VS Dev Web Server was limited because it supported only certain features. So as such, there was still just one production-quality "host" for typical ASP.NET applications that depended on System.Web.

一晃近十年,并 OWIN 绕过来为应用程序和Web服务器之间的接口。这允许任何OWIN兼容的应用程序,以通过OWIN交谈上有一座OWIN兼容的主机层的web服务器。微软写道 的武士刀为一体OWIN实现,它可以托管的ASP.NET Web API,ASP.NET SignalR和许多第三方框架对几台服务器,包括IIS(和IIS前preSS),武士刀的自我主机服务器和定制主机顶部(即运行武士刀在一个自定义应用程序主机)。还有一个OWIN实现调用 Nowin 应该能够作为卡塔纳运行相同的应用程序。这是主机不可知论的例子。

Fast forward about a decade and OWIN came around as an interface between applications and web servers. This allowed any OWIN-compatible application to talk through OWIN to a web server that had an OWIN-compatible hosting layer. Microsoft wrote Katana as one OWIN implementation that could host ASP.NET Web API, ASP.NET SignalR, and many 3rd party frameworks on top of several servers, including IIS (and IIS Express), Katana's self-host server, and custom hosts (i.e. run Katana's host in a custom app). There's another OWIN implementation called Nowin that should be able to run the same apps as Katana. This is an example of host agnosticism.

现在快进几年的时间,并有 ASP.NET vNext ,它遵循​​非常相似OWIN在具有条件的典范中间件和有主机不可知论。 ASP.NET vNext有OWIN中间件应用组件兼容层为好。

Now fast forward another few years and there's ASP.NET vNext, which follows a model very similar to OWIN in terms of having middleware and having host agnosticism. ASP.NET vNext has compatibility layers for OWIN middleware app components as well.

ASP.NET vNext是主机中的相同方式卡塔纳和OWIN不可知的。使用ASP.NET vNext只知道一台主机的抽象层编写的应用程序,如 IApplicationBuilder (原 IBuilder )接口。应用程序不直接交谈的Web服务器。大部分这种抽象是通过功能接口这样做,一些服务器可以实现的功能和其他人可以选择不。

ASP.NET vNext is host agnostic in the same manner as Katana and OWIN. Applications written using ASP.NET vNext only know about a host abstraction layer, such as the IApplicationBuilder (formerly IBuilder) interface. Applications do not talk directly to the web server. Much of this abstraction is done through "feature interfaces" so that some servers can implement features and others can choose not to.

ASP.NET vNext应用程序可以在IIS,IIS防爆preSS,自己的自定义EXE主办,在新的跨平台的红隼服务器,并在未来无疑更多的主机。

ASP.NET vNext applications can be hosted on IIS, IIS Express, your own custom EXE, in the new cross-platform Kestrel server, and no doubt more hosts in the future.

无论是武士刀,也不ASP.NET vNext是IIS或其他主机替代品,虽然他们都有替代Web服务器。相比武士刀和ASP.NET vNext,IIS支持一些更先进的功能,如应用热身,更丰富的应用程序生命周期管理(即做什么,当应用程序崩溃,控制它使用的内存,和其他类型的节流) ,远程管理,等等。

Neither Katana nor ASP.NET vNext are replacements for IIS or other hosts, though they do both have alternative web servers. IIS supports some more advanced features as compared to Katana and ASP.NET vNext, such as application warm-up, richer application lifetime management (i.e. what to do when the app crashes, controlling how much memory it uses, and other types of throttling), remote management, and so forth.

因为我从来不是该组的一部分,我不能到说话的动机创造OWIN。但有一个Web服务器主机的抽象的优点有很多:

I can't speak to the motivations for creating OWIN because I was never part of that group. But the merits of having a web server host abstraction are many:


  • 可以在主机之间相对轻松切换。例如,它是常见的,可以以最小的权限运行一个只发展的服务器上本地运行。然后,在部署到生产,使用也许是更全功能的主机,如IIS。 IIS,但是,需要管理权限才能安装,这不是每个人都有自己的工作站上。

  • 可以存在
  • 更托管选项。归途中的一天,因为在IIS上只有一台主机可能存在ASP.NET的密切相关性,因此有效地没有市场的其他主机。

  • 某些类型的测试是容易通过具有一个内存测试主机写。这用于经常测试的web应用程序的,但没有任何网络调用整个堆叠。

有关ASP.NET vNext的动机中列出了部分关于在<一个官方ASP.NET vNext网站href=\"http://www.asp.net/vnext/overview/aspnet-vnext/getting-started-with-aspnet-vnext-and-visual-studio\">Getting入门教程。简单总结就是:有一个跨平台的,开放源码的,并排侧,随收随付你去,主机无关的平台,为构建Web应用程序和服务。听起来像一些营销的东西,但这些系统的所有主要方面。提供的NodeJS pretty多本完全相同的特性,但当然,一旦你看看细节,当然有许多实现差异,毫无疑问,一些深层次的哲学差异也较大。支持这些功能的动机一般都是不言自明的。

The motivations for ASP.NET vNext are listed in part on the official ASP.NET vNext site in the Getting Started tutorial. A brief summary is: to have a cross-platform, open source, side-by-side, pay-as-you-go, host-agnostic platform for building web apps and services. Sounds like some marketing stuff, but these are all key aspects of the system. NodeJS offers pretty much this same exact set of features, though of course once you look at the details, there are of course many implementation differences and no doubt some deeper philosophical differences as well. The motivations for supporting these features are generally self-explanatory.

请注意,这是关于ASP.NET的一般观众,其中包括一切从ASP.NET Web窗体,MVC的,网络API,SignalR,武士刀,和ASP.NET vNext。这些框架适用于任何规模的项目,并应在任何合理的技术开发人员可以使用。这通过观察的使用它们的项目的大小是显而易见的。这个非常网站(StackOverflow.com)建在部分使用ASP.NET MVC,通过一些非常先进的开发者(我认为),但也有利用相对新手MVC内置诸多小网站。 ASP.NET vNext是大多数这些相同的框架的未来版本,因此,它的目标相同类型的应用程序和相同类型的开发者。

Note that this is about the audience of ASP.NET in general, which includes everything from ASP.NET Web Forms, to MVC, Web API, SignalR, Katana, and ASP.NET vNext. Any of these frameworks are suitable for any size project and should be usable by any reasonably skilled developer. This is evident by looking at the sizes of projects that use them. This very site (StackOverflow.com) is built in part using ASP.NET MVC, by some very advanced developers (I assume), yet there are many much smaller sites using MVC built by relative novices. ASP.NET vNext is the future version of most of these same frameworks, and as such it targets the same type of applications and the same type of developers.

有关ASP.NET vNext和OWIN一些更多的信息,从开发者的一个检查出一篇博客文章:<一href=\"http://whereslou.com/2014/06/10/asp-net-vnext-moving-parts-owin/\">http://whereslou.com/2014/06/10/asp-net-vnext-moving-parts-owin/

For some more info on ASP.NET vNext and OWIN, check out a blog post from one of the devs: http://whereslou.com/2014/06/10/asp-net-vnext-moving-parts-owin/

这篇关于ASP.NET vNext是主机无关,这是什么意思深?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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