Upload
jsc-arcadia-inc
View
2.351
Download
2
Embed Size (px)
Citation preview
ASP.NET 5
Александр Шевнин, Аркадия
2
About myselfAlexander ShevninJSC “Arcadia Inc.”[email protected]
In Arcadia from 2012, last 2 years work mostly with ASP.NET, C#, AngularJS and TypeScript
3
Web Development with Microsoft• ASP – Active Server Pages – 1996 – VBScript, Jscript
4
Web Development with Microsoft• ASP – Active Server Pages – 1996 – VBScript, Jscript• XSP ( because everything cool starts with X) – prototype, written in Java
5
Web Development with Microsoft• ASP – Active Server Pages – 1996 – VBScript, Jscript• XSP ( because everything cool starts with X) – prototype, written in Java • ASP.NET – 2002• ASP.NET MVC – 2007• ASP.NET MVC 3 – 2011 – Razor introduced• ASP.NET 5 RC – November 2015
New stack• VS2015• ASP .NET 5 (ex-vNext)• MVC 6• .NET Core vs .NET Framework vs Mono• DNVM (.NET Version Manager)• DNX (.NET Execution Environment)• DNU (.NET Development Utilities)• Kestrel
.NET Core• Primary goal: provide a single, modular, cross-platform version of .NET that works the
same across all platforms (Linux, Mac, iOS, Android)• Consists of:
• CoreFX (libraries)• CoreCLR (Microsoft.CoreCLR)
• Distributed via NuGet• Portable
DNX (.NET Execution Environment)• New project.json• Can cross-compile for both .NET Framework and .NET Core
• Recommendation from ASP.NET team: target both frameworks
DNX
Hosting model• dnu build & dnu pack & dnu publish• It’s possible to publish on Docker host (Azure or custom)• Kestrel Web server (https://github.com/aspnet/KestrelHttpServer/), based on libuv• IIS
• Helios up to beta7 (Microsoft.AspNet.Server.IIS) – uses existing System.Web• Kestrel from beta8 through IIS HTTP Platform Handler (https://
github.com/aspnet/Announcements/issues/69
11
HTTP Platform Handler
12
Benefits/Consequences of Kestrel• IIS 7.5 at least (Win7)• Eases development for Microsoft• IIS AppPool does not need to run any managed code• No need in Windows Server• Existing modules still can run in IIS alongside the HttpPlatformHandler• No web.config (only app.config)• Unified servicing and boot-up• Integration with existing modules might be HARD
Client-Side Development• Gulp, Grunt support• Bower, npm support• Yeoman templates
RIP• No more Web Forms• HttpHandler-related features: e.g. Bundles• MVC – WebAPI separation • NuGet install.ps1/uninstall.ps1/content https://github.com/NuGet/Home/issues/627 • System.Web.HttpContext and so on
Startup• Startup class – entry point
Owin
17
Owin Middleware
Dependency Inversion• Both Dependency Injection and Service Locator support• Lifetimes:
• Transient• Scoped• Singleton• Instance
• Default implementation can be replaced with any other IoC container (e.g. Autofac)
19
Tag Helpers• Replacement of HTML Helpers• Can be used as:
• Can be asynchronous
Tag Helpers
Html.Action -> View Components
22
Html.Action -> View Components
xUnit.net
Q & A