https://github.com/dotnet/core
https://github.com/aspnet/home
今天看到 .NET Core 的改名計划,感覺跨平台的時代快要來了,從之前的 ASP.NET NEXT,ASP.NET 5,ASP.NET Core 1.0 等概念一路演變過來,花了點時間總結一下幾個相關的概念。
OWIN 與 Katana 的關系
ASP.NET Core 1.0 的由來,要追溯到 Katana 這個項目, Katana 是 OWIN 定義規范的一個實現組件集合。
Open Web Interface for .NET (OWIN)
OWIN 是 Open Web Server Interface for .NET 首字母縮寫,OWIN 定義了 Web 服務器和應用程序組件之間的交互的規范(specifications); OWIN 在 .NET Web 服務器和 .NET Web 應用之間定義了一套標准的接口,其目的是為了實現服務器與應用之間的解耦。由於這一規范的目的是發展一個廣闊且充滿活力的、基於 Microsoft .NET Framework 的 Web 服務器和應用程序組件生態系統,因此它可以將服務器與應用程序之間的交互減少到一小部分類型和單個函數簽名,這個函數簽名被稱為應用程序委托(即 AppFunc)
Owin定義規范
服務器 (Server)
HTTP 服務器直接與客戶端交互, 並用 OWIN 語義處理請求, 服務器需要一個適配層將客戶請求轉換成 OWIN 語義。 支持 OWIN 的服務器有 Katana 和 Nowin 。
Web 框架 (Web Framework)
構建在 OWIN 之上的自包含的獨立組件, 向 Web 應用提供可用的對象模型或者接口。 Web 框架可能需要一個適配層來轉換 OWIN 語義。 支持 OWIN 的 Web 框架有:
- Nancy
- SignalR
- WebApi
- FubuMVC
- Simple.Web
- DuoVia.Http
Web 應用 (Web Application)
一個特定的 Web 應用, 通常構建在 Web 框架之上, 使用 OWIN 兼容的服務器運行。
中間件 (Middleware)
特定的目的的服務器和應用之間的可插拔組件, 可以監視、 路由、 修改請求與響應。
宿主 (Host)
應用與服務器所在的進程, 主要負責應用的啟動, 有些服務器自身也是宿主, 比如 Nowin 。
Katana
Katana 是 OWIN 規范定義實現的一個組件和框架集合,可以按其中每個層都能夠輕松替代的方式來解耦;OWIN 與 Katana 是 ASP.NET 5 之前東西,關於 host, server,middleware 相關實現的源碼可以在github上找到(https://github.com/aspnet/AspNetKatana),之前實現的 OAuth 2.0 認證授權 也都是基於 Microsoft.Owin.Security.OAuth 來實現的,不過現在 MS 已經不更新新的功能了(常規 fix bug); ASP.NET Core 是支持 OWIN 定義的實現的,也就是 ASP.NET Core 重新設計的 HttpAbstractions 子集,定義在 Microsoft.AspNetCore.Owin 包中。
Katana 與 ASP.NET Core 對應關系
Many of the components, features, and models of Katana are now part of the ASP.NET Core project on GitHub. See https://github.com/aspnet/home for details. We still plan to release updates to Katana itself to address common problems and keeping it up-to-date.
Here is a list of Katana components and where you can find their ASP.NET Core counterparts:
- Microsoft.Owin - https://github.com/aspnet/HttpAbstractions
- Microsoft.Owin.Diagnostics - https://github.com/aspnet/Diagnostics
- Microsoft.Owin.FileSystems - https://github.com/aspnet/filesystem
- Microsoft.Owin.StaticFiles - https://github.com/aspnet/staticfiles
- Microsoft.Owin.Hosting, Microsoft.Owin.Testing, OwinHost - https://github.com/aspnet/hosting
- Microsoft.Owin.Security.* - https://github.com/aspnet/Security
- Microsoft.Owin.Host.HttpListener - https://github.com/aspnet/HttpSysServer
- Microsoft.Owin.Host.SystemWeb - https://github.com/aspnet/iisintegration
- Microsoft.Owin.Cors - https://github.com/aspnet/cors
ASP.NET 5 與 ASP.NET Core 1.0
如果還不曉得ASP.NET Next 與.NET Core是什么,可以先補充下知識
魅力 .NET:從 Mono、.NET Core 說起
vNext之旅(1):從概念和基礎開始
今天看到了 ASP.NET 5 is dead - Introducing ASP.NET Core 1.0 and .NET Core 1.0 ,雖然只是改名字,但是覺得微軟這次對.NET與 ASP.NET設計的非常好,之前命名的名詞與版本號確實太多總是感覺怪怪的[ASP.NET vNext => ASP.NET 5 => ASP.NET Core 1.0],晚上查了查相關文章,大致了解一下。之前偶爾https://docs.asp.net/en/latest/上面的文檔,以及http://www.asp.net/ 時常還有 ASP.NET vNext的影子,現在已經沒有了,按照線路圖的發展,估計在2016年3月份會RTM[時間暫定了]。
重新命名版本號
重新引入
- ASP.NET 5 現在是 ASP.NET Core 1.0.
- .NET Core 5 現在是 .NET Core 1.0.
- Entity Framework 7 現在是 Entity Framework Core 1.0 或者 EF Core 1.0
如何選擇?
非常明確的是,ASP.NET 4.6 是個更成熟的平台,經過了很好的測試。 ASP.NET Core 1.0 是 1.0 版本,包括 Web API 和 MVC,但是不包括 SignalR 或者 Web Pages。ASP.NET Core 1.0 不支持 VB 或者 F#。
ASP.NET Core 1.0 並不是結束,僅僅是個全新的開始(開源、組件化、跨平台), ASP.NET 4.6 還會繼續更新,繼續提供完整的支持。關於具體的說明看官方的吧:
https://docs.microsoft.com/zh-cn/dotnet/standard/choosing-core-framework-server
https://docs.microsoft.com/zh-cn/aspnet/core/choose-aspnet-framework -
.NET CLI
DNX(a .NET Execution Environment) 是ASP.NET程序的運行環境,可以使用DNVM(.NET Version Manager)管理各種版本的DNX,不過已經被廢棄,取代的是.NET CLI 新的命令行工具,這一特性打算在RC2版本改變(不過官方的文檔還是基於DNX的,所以可以先等更新到RC2版本)。
根據文檔中描述到 https://github.com/dotnet/cli/blob/master/Documentation/intro-to-cli.md
.NET Core includes three new components: a set of standalone command-line (CLI) tools, a shared framework and a set of runtime services. These components will replace DNX and are essentially DNX split in three parts. ASP.NET 5 will transition to the new tools for RC2. This is already in progress. There will be a smooth transition from DNX to these new .NET Core components.
DNX (a .NET Execution Environment)在github上也給了說明:
The DNX is being retired in favor of the new dotent CLI command line tools. See:
- http://dotnet.github.io/getting-started/
- http://github.com/dotnet/cli
As a result, we're not accepting anymore changes to this project. Please file any new issues on http://github.com/dotnet/cli.
CLI在MAC下安裝也很簡單,下載包NEXT即可,現還沒有CentOS的包。
ASP.NET Core 下有哪些包
https://docs.microsoft.com/zh-cn/aspnet/core/api/#namespaces-in-the-aspnet-core-class-library
REFER:
owin
http://owin.org/
Katana
https://github.com/aspnet/AspNetKatana
ASP.NET Core Schedule and Roadmap
https://github.com/aspnet/home/wiki/roadmap/
ASP.NET Core doc
https://docs.microsoft.com/zh-cn/aspnet/core/
Katana 項目入門
https://msdn.microsoft.com/zh-cn/magazine/dn451439.aspx
Exploring the new .NET "dotnet" Command Line Interface (CLI)
http://www.hanselman.com/blog/ExploringTheNewNETDotnetCommandLineInterfaceCLI.aspx
Announcing ASP.NET 5 Release Candidate 1
http://blogs.msdn.com/b/webdev/archive/2015/11/18/announcing-asp-net-5-release-candidate-1.aspx
ASP.NET 5 and .NET Core RC1 in context (Plus all the Connect 2015 News)
http://www.hanselman.com/blog/ASPNET5AndNETCoreRC1InContextPlusAllTheConnect2015News.aspx
ASP.NET 5 已終結,迎來 ASP.NET Core 1.0 和 .NET Core 1.0
http://www.oschina.net/news/70049/aspnet5-is-dead-introducing-aspnet-core-1-0-and-netcore-1-0