ASP.NET 5 是 Microsoft 首個真正跨平台的 Web 開發框架,使用程式碼管理依賴和功能,無需依賴 IIS 和特定作業系統。它獲得了強大的模組化支持,並整合了前端框架如 gulp.js 和 bower.js,提高了開發效率。此框架消除了傳統的 web.config,並具備從初學者到專業開發者的全面工具支持。
7. ASP.NET 5 vs. ASP.NET 4-
了解其中的差異,以消除莫名的恐懼。
程式設計模型
架構
工具
部署
由程式碼決定應用程式應有的功能。
ASP.NET 5 ASP.NET 4-
由安裝 IIS 所設定的模組功能決定。
具有強大彈性的 Package-based 相
依,且只有超輕量的 Runtime。
相依於大包的 .NET Framework 裡面
的 System.Web.dll。
Visual Studio, Visual Studio Code,
Sublime 或其他 Open Source 工具。
Visual Studio (Web Form)
Visual Studio, VS Code (MVC)
IIS 只是附加,ASP.NET 5 預設使用
Kestrel Server。
原則上只能掛在 IIS 上,目前只有
Web API 具有 Self-hosting 的能力。
8. ASP.NET 5 vs. ASP.NET 4- Web Form
了解其中的差異,以消除莫名的恐懼。
程式設計模型
架構
前端介面
MVC-based, 沒有 Web Form
ASP.NET 5
ASP.NET 4-
Web Form
Web Form 程式設計模型
Controller, Model,
View: View Component, Tag Helpers
Page, Master Page
User Control, Custom Control
VC, Tag Helpers: C#
View: Razor
Control-based
HTML/CSS/JavaScript Render
16. 如何取得 ASP.NET 5 的開發工具?
• 微軟幫你準備好了 Microsoft ASP.NET
and Web Tools for ASP.NET 5 (RC)
• 安裝 Visual Studio 2015 Update 1 後,自
動就有這工具了。
其他的平台,可到 https://get.asp.net/
取得必要的工具
29. Hosting 的改變
• ASP.NET 5 除非使用 IIS Platform Handler,否則預設使用
Kestrel Server 作為 Hosting 的基底。
• Kestrel Server (Microsoft.AspNet.Server.Kestrel) 支援跨平台的
Hosting。
• Kestrel Server 直接支援 IIS-based hosting 以及 Self-hosting 兩
種方式。
30. IIS Platform Handler
IIS Platform HandlerHTTP.SYS
Web AppWeb App
aspnet_wp aspnet_wp
Web App
Kestrel
Server
Web App
Kestrel
Server
IIS Hosting Mode (ASP.NET 4-) IIS Platform Handler (ASP.NET 5)
31. 結語
• ASP.NET 5 是 Microsoft 第一個真正的 Web 應用開發的平台。
• 豐富的套件支援 (前端+後端),Visual Studio 便利的專案管理方
式,使生產力大增。
• ASP.NET 5 跨平台的願望正式實現。
• 不過…要先習慣沒有 Web.config 的世界
32. References
• ASP.NET Official: http://asp.net/vnext
• Documentation: http://docs.asp.net
• Web Team Blog: http://blogs.msdn.com/webdev
• ASP.NET GitHub: http://github.com/aspnet