ASP.NET 5 “A lean and composable framework for building web and cloud applications”

Slides:



Advertisements
Similar presentations
What’s New in ASP.NET 5 and Visual Studio 2015 SPENCER SCHNEIDENBACH GADELLNET CONSULTING SERVICES.
Advertisements

The Future of Web WakeUpAndCode.com.
Kay Herzam Herzam IT Consulting What‘s new in ASP.NET MS TechTalk.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
ASP.NET vNEXT & development tools Marco De
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
ASP.NET 5 Visual Studio 2015 Templates Bill Wolff Rob Keiser June 10, 2015.
Introducing NativeScript [Pavel Kolev Software Telerik: a Progress company]
1 CONFIDENTIAL.NET FEATURES OVERVIEW C# 6 ASP.NET 5 DNX PROJECT ASP.NET MVC 6 EF 7 A UGUST 4, 2015.
Session Information Goals CTAs Customer Evidence TBD
What’s New in ASP.NET 5 (vNext)? SoftUni Team Technical Trainers Software University Lean.NET stack for building modern web apps.
64-bit JIT + SIMD Garbage Collector Runtime components Compilers.NET Compiler Platform (Roslyn) Languages innovation.NET Framework 4.6.NET Core.
ASP.NET 5 Unleashed Javier Lozano
ASP.NET Core* 1.0 The Future of Web Apps Shahed Chowdhuri
Microsoft Ignite /28/2017 2:36 PM
1 Adding a Model. We have created an MVC web app project Added a controller class. Added a view class. Next we will add some classes for managing movies.
61% YoY Growth.NET Active Developers (VS 2012+) 40%.NET Core downloads by new developers 62% GitHub contributions from outside of Microsoft (corefx.
By: Ahmed Marzouk OWIN & KATANA. Agenda A Brief History What is OWIN and Why? What is KATANA? OWIN Specifications OWIN/KATANA Goals.
Migrating to ASP.NET Core Challenges & Opportunities
ASP.NET Core* in 2017 The Future of Web Apps Shahed Chowdhuri
What is it all about? .NET MeetUp in Prague, CZ (2017/7/19)
Top 10 Entity Framework Features Every Developer Should Know
DevOps with ASP.NET Core and Entity Framework Core
Introducing the Microsoft® .NET Framework
Modernizing your. NET applications with. NET Standard,
Build and Learn ASP.NET Workshop.
Building Desktop Apps with Node.js and Electron
Introduction to ASP.NET Core
Getting started with .NET Core
DotnetConf 9/10/2018 7:49 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE.
Hello World Admir Tuzović Chief Technology App Impact
ASP.NET Core 2.0 Fundamentals
Node.js Express Web Services
ASP.NET Core* 1.0 The Future of Web Apps Shahed Chowdhuri
 .NET CORE
Logo here Module 3 Microsoft Azure Web App. Logo here Module Overview Introduction to App Service Overview of Web Apps Hosting Web Applications in Azure.
Did your feature got in, out or planned?
ASP.NET in Linux and Windows containers
Lean .NET stack for building modern web apps
Introducing ASP.NET Core 2.0
Microsoft Virtual Academy
1.1. .NET architectural components and .NET Core
Module 0: Introduction Chapter 2: Getting Started
Module 1: Getting Started
SPA Revolution with WebAssembly and Blazor Rainer Stropek | software
MVC in ASP.NET Core: The new kid on the block
Explore web development with Microsoft ASP.NET Core 1.0
What is it all about? .NET MeetUp in Amsterdam, NL (2017/7/11)
Microsoft Build /11/2018 2:12 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Microsoft Ignite NZ October 2016 SKYCITY, Auckland
Building Modern Web Apps with ASP.NET MVC 6
Dive deep into ASP.NET Core 1.0
Explore web development with Microsoft ASP.NET Core 1.0
Slides and images stolen from “real” .NET Conf. presenters
Microsoft Build /15/2018 6:28 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Should I Transition to .NET Core? Will it hurt?
SPA Revolution with WebAssembly and Blazor Rainer Stropek | software
Entity Framework Core.
Microsoft Connect /1/2018 2:36 AM
Nathan Totten Technical Evangelist Windows Azure
ASP.NET CORE ИСПЫТАНИЕ БОЕМ
ASP.NET 5 és ami mögötte van – a gyakorlatban
Eagle: Maturation and Evolution
Martin MSBuild Martin
#01# ASP.NET Core Overview Design by: TEDU Trainer: Bach Ngoc Toan
Running C# in the browser
Concepts in ASP.NET Core App
ASP.NET Core Middleware Fundamentals
ASP.NET Core 2.0 The Future of Web Apps Shahed Chowdhuri
What’s ASP.NET 5 and Why? Scott Hunter | Director of Program Management Scott Hanselman | Principal Program Manager.
Presentation transcript:

ASP.NET 5 “A lean and composable framework for building web and cloud applications”

ASP.NET now Built upon a monolithic .NET 4.* framework Slow release cycles BUT! Stability is not an issue – good quality and cohesive, unified platform Typically one FW version installed / machine – is that really an issue in the public cloud? Well-defined set of events in the HTTP request pipeline Extensibility through Modules, Handlers etc. Goes hand-in-hand with IIS How do you innovate when stability has to be maintained on millions of devices without introducing a breaking change?

ASP.NET 5 Concepts Cross platform Modular EntityFramework Mvc Antiforgery CORS Diagnostics Identity Caching Routing IISIntegration …

ASP.NET 5 Concepts Truly Open source -– check repos at github.com/aspnet not only “source opened”, public GitHub repos with issue tracking non-MS contributors participate, community members can (and do) send pull requests

ASP.NET 5 Concepts Why not?! “Why did you open source the new ASP.NET?” An attitude / strategy change at Microsoft towards “Mobile first, Cloud first” Why not?!

ASP.NET 5 Concepts Deeply inspired by Node, Ruby… Run your code anywhere, with any runtime (NVM, RVM) Light-weight, componentized frameworks Fast iteration cycles during development Provide a strong REPL experience - coming to C# Web app hosting is not tied to IIS – Kestrel, IIS, WebListener Wide palette of dev tooling – still best quality IDE support on Windows! Don’t fear the CLI Composable and minimal – achieve high performance If you need a raw TCP socket, so be it Cloud-ready + rich tooling in Visual Studio 2015 Right click, Publish… experience further improved Azure Web app, Docker on a Linux VM

Dev stack comparison current vs vNext

Current ASP.NET stack

ASP.NET 5 Development stack

.NET Core = CoreCLR + CoreFX CoreCLR = .NET Core Runtime + mscorlib GC, JIT compiler, base .NET data types, low-level classes CoreFX = foundational libraries collections, file systems, console, XML, async, SqlClient… https://github.com/dotnet /coreclr /corefx Works with ASP.NET, that’s OK. But console tools as well Even more: on Connect(); event native compilation was announced! This means .NET native on Windows, Linux, OS X

ASP.NET 5 & .NET Core are RC What does it mean? Far from RTM? Working on ASP.NET 5 for ~ 2 years “Go Live” support for prod systems Feature complete No breaking changes are expected in code, only minor API changes RC 2 will come until 2016 – DNX will be sliced into 3 pieces RTM is expected by the end of February 2016 Further performance improvements are to be expected until RTM

Full .NET FW vs .NET Core Which to choose when? Cross-platform – Windows, Linux, OS X,… Deploy FW with your app – multiple FWs on the same machine Runs in its own isolated unit – unaffected by system-wide patches Microsoft puts huge invests into it, innovation takes places here easier You want a fully open source stack Full .NET FW Reliable & fault tolerant production grade applications Windows-heavy applications When cross-platform is not an objective

DNX SDK + Runtime environment = all you need to build & run .NET on any platform Managed entry-point discovery Host process for your .NET application (ASP.NET & console app) provides a set of services to applications through DI e.g.: IServiceProvider, IApplicationEnvironment, ILoggerFactory Hosts the CLR Different “flavors” (CoreCLR, Mono, Full .NET FW) Open source friendly load dependency’s source instead of binary  build in-memory  debug “Develop on one platform. Run it anywhere” How to obtain it?

DNVM – 1: .NET Version Manager Manage installed DNX’s on a machine Strong resemblance with NVM and RVM How to get? Windows: part of tooling that comes with AspNet5.ENU.RC1.msi OS X / Linux curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh What you get? Just a bunch of PS / bash scripts

DNVM – 2: command line tool Available DNVM commands

DNVM – 3: How’s a DNX installed? dnvm install latest –r {RUNTIME FLAVOR} Runtime can be: coreclr | mono | clr

DNVM – 4. Choose an installed DNX dnvm list dnvm use Just a text file in .dnx/alias folder Persist: adds to user path as well

Hosting – IIS or Kestrel or… Kestrel is a .NET based cross-platform web server Built on top of LibUV Cross-plat C library Asynchronous IO & Networking Used by NodeJS as well On Linux and Mac  Kestrel: command line with DNX On Windows Kestrel: command line with DNX IIS: bit different than what we get used to so far not in-proc in IIS, ASP.NET runs in its own process (dnx.exe) IIS creates process, forwards request to it etc.

How to get started? get.asp.net Windows OS X 1.) Install VS2015 2.) Download the ASP.NET 5 RC1 installer – runtime + tooling in a single MSI 3.) dnvm upgrade 4.) File – New Project… OS X 1.) Get DNVM with CURL 2.) If you’d like to use Mono install it with Homebrew 2.) Get DNX for CoreCLR or Mono curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh dnvm upgrade -r coreclr

New Project Structure wwwroot – JS / CSS / HTML References - .NET assemblies Dependencies – NPM / Bower packages Multi-Targeting global.json project.json .xproj, .sln appsettings.json

global.json projects [ ] – which folders contain source code? sdk { } – which DNX version is targeted?

project.json wwwroot location Application version .NET Dependencies Commands Target frameworks Exclusions Scripts to run

project.json – project.lock.json Not for humans Project.lock.json – flatten dependencies, write means recalc, just like Gemfile.lock

Framework multi-targeting JSON object in project.json With .NET Core frameworks are just folders on disk C:\users\gkovacs\.dnx\runtimes\dnx-coreclr-win-x64.1.0.0-rc1-final Compile for both .NET and .NET Core from the same project type in one step Separate dependencies for each target FW in Solution Explorer Different icons for NuGet / binary / FW assemblies

Commands Support for command line tooling Supports simple invocation of a managed entry point Can be invoked with DNX Example: Start Kestrel Web server When packaged, Commands are made into PS / bash scripts

DNU – .NET Development Utility Build a project – produce assemblies from source Package feed configuration (nuget.org, MyGet, VSO,…) List dependencies of a given project Create a NuGet package from a folder Publish Restore packages Wrap csproj -> project.json

Dependency management - NuGet NuGet everywhere – each project is made into a NuGet and referenced like that View the transitive dependencies in a hierarchical view Same JSON property whether it be NuGet, assembly ref, source from an open source project whatever else “I have a list of deps, but I don’t care where they come from”

Dependency mgmt. – Bower & NPM

Application Startup Convention based entry point in Startup class’s Configure() method Configure() ConfigureServices()

Startup.Configure() Injected through the DI container

HTTP request pipeline – 1. Overview HTTP request pipeline is fully customizable Middleware concept – you define your own events

HTTP request pipeline – 2. Simple example Two very simple example for middlewares Use() and Run() Run accepts a delegate with no “next” reference in its signature. Becomes always the last one in the pipeline

HTTP request pipeline – 3. Customization Customizable to the last bit – “Only get what you’ve paid for” Static File handling (yes, even that!) Dev time: BrowserLink Dev time: Exception & DB error pages How does it come to IIS? How does it relate to OWIN? Migration is supported (Katana interface is similar, IAppBuilder) Has OWIN compatibility, but ASP.NET 5 itself is NOT built on top of OWIN

Configuration Where is my web.config? A Code-based configuration approach ConfigurationBuilder class .AddJsonFile() .AddEnvironmentVariables() Environmental awareness – built-in support for multiple environments

Dependency Injection ASP.NET 5 has built-in DI support for basic scenarios Core to ASP.NET, own FW’s like MVC use DI to get their components can replace with your custom easily Typically through extension methods in Startup.ConfigureServices(IServiceCollection services) Transient – new instance each time when requested (light-weight & stateless) Scoped – once per request Singleton – created on first request, then same instance is served in subsequent requests Instance – add a single instance, non lazy loaded compared to Singleton

MVC 6 - Brief A fusion of Web API and MVC Using the same routing / filters / dependency injection… Follows the ASP.NET 5 philosophy Just step in Startup.Configure()

MVC 6 – Tag Helpers Razor (no CSS IntelliSense in @class as we’re in C#) Tag Helpers Same equivalents of HTML Helpers Using HTML Attributes instead of C#

EF 7 – Brief Light-weight & extensible Supports different OS’es Supports different DB technologies (e.g.: SQLite on OS X) Not only for relational DBs: Azure Table Storage & Redis Removing: EDMX, ObjectContext, MEST, very complex type <-> table mappings

Performance github.com/aspnet/benchmarks TechEmpowered PlainText benchmark Sends back “Hello World” Goes through the HTTP pipeline (routing, etc.) (ASP).NET perf on Win vs Linux?

Deployment – Visual Studio tooling File System Docker on a Linux VM: right click, Publish Azure Web App: right click, Publish

Deployment – Visual Studio tooling Content to be published Invoke MSDeploy

Tools for Cross-Platform Development VSCode is always a fine option on OS X & Linux No .xproj, .sln files required – completely decoupled from Visual Studio OmniSharp -> not only in VSCode but Sublime, Emacs… Determines runtime based on global.json Parses discovered DNX projects to provide code editor services

Tools for Cross-Platform Development

X-Plat is not easy Max path restriction Console.Color ??? Eventing – no ETW other places, some analogue is found, usually OS es have same needs but implemented differently – same exp is provided SqlClient and ADO.NET had lots of native dependencies on Windows, built ~10 years ago. Porting was a P.I.T.A. SqlClient almost completely rewritten in C# to support other OSes Hard to achieve a dev experience like VS on other OS’es Exception handling / (async) debugging / interactive windows / live perf view / BrowserLink / designers… (solved)

Resources Try it at home - get.asp.net Books – not yet Read the docs - docs.asp.net Channel9, MVA courses… Check the source github.com/aspnet github.com/dotnet/coreclr github.com/dotnet/corefx Community Standups – live.asp.net

Q&A

https://pixelastic.github.io/pokemonorbigdata/