.NET Core and DNX Chrisitan Horsdal Horsdal Consult @chr_horsdal - - PowerPoint PPT Presentation

net core and dnx
SMART_READER_LITE
LIVE PREVIEW

.NET Core and DNX Chrisitan Horsdal Horsdal Consult @chr_horsdal - - PowerPoint PPT Presentation

.NET Core and DNX Chrisitan Horsdal Horsdal Consult @chr_horsdal .NET Core Middleware DNX X-Plat About me Christian Horsdal Independent Consultant www.horsdal-consult.dk c.horsdal@gmail.com @chr_horsdal ASP.NET 5 Everything changes


slide-1
SLIDE 1

.NET Core and DNX

Chrisitan Horsdal Horsdal Consult @chr_horsdal

slide-2
SLIDE 2
slide-3
SLIDE 3

.NET Core Middleware DNX X-Plat

slide-4
SLIDE 4

About me

Christian Horsdal Independent Consultant www.horsdal-consult.dk c.horsdal@gmail.com @chr_horsdal

slide-5
SLIDE 5

ASP.NET 5

Everything changes

slide-6
SLIDE 6

ASP.NET Today

IIS .NET BCL ASP.NET ASP.NET MVC ASP.NET Web API HTTP Modules ASP.NET WebForms HTTP Handlers Request pipeline HTTP Context et al. Caching Session State

slide-7
SLIDE 7

ASP.NET – things not in 5

IIS .NET BCL ASP.NET ASP.NET MVC ASP.NET Web API HTTP Modules ASP.NET WebForms HTTP Handlers Request pipeline HTTP Context et al. Caching Session State

slide-8
SLIDE 8

ASP.NET – and things changed in 5

IIS .NET BCL ASP.NET ASP.NET MVC ASP.NET Web API HTTP Modules ASP.NET WebForms HTTP Handlers Request pipeline HTTP Context Caching Session State

slide-9
SLIDE 9

Highlights of ASP.NET 5

  • DNX runtime
  • Modularized .NET
  • Cross platform .NET
  • Side-by-side deploy
  • OWIN / Middleware
  • Independent of Visual Studio
  • Unified MVC and WebAPI
slide-10
SLIDE 10

Why Do I Care?

  • DNX and cross platform:
  • Broader eco system
  • DNX as enabler for your own tooling
  • DNX as enabler for 3rd party / OSS tooling
  • Use Linux in prodcution
slide-11
SLIDE 11

Why Do I Care?

  • Modularized .NET
  • Smaller footprint on disk and memory
  • Faster development from MS on some parts
  • Side-by-side on different versions
slide-12
SLIDE 12

Why Do I Care?

  • Middleware
  • Nice modular way of working
  • Sparation of infrastructure and application
slide-13
SLIDE 13

Roadmap

Milestone Release week Beta6 27 Jul 2015 Beta7 2 Sep 2015 Beta8 5 Oct 2015: Feature complete RC1 Nov 2015: Stabilized 1.0.0 Q1 2016 > 1.0.0 Maybe Q3 2016: VB.NET, SignalR, WebPages

13

slide-14
SLIDE 14

.NET CORE

slide-15
SLIDE 15

AKA: Cloud Optimized Framework

  • Because cloud. CLOUD. CLOUD
  • Trimmed down
  • Opt-in to more through NuGets
  • Not in GAC
slide-16
SLIDE 16

BIN Deploy

16

Source code dnu publish Server with DNX xcopy

slide-17
SLIDE 17

Side-by-side deployment

17

App 1 .NETCore v. X App 2 .NETCore v. Y App 3 .NETCore v. Z

slide-18
SLIDE 18

What In and What’s Out?

  • No System.Web
  • No desktop stuff
  • WPF
  • Winforms
  • GDI
  • No Windows APIs – system32

18

slide-19
SLIDE 19

No System.Web

  • System.Web is at the very core of ASP.NET today
  • Context
  • Request
  • Response
  • Session
  • Pipeline (that nasty global.asax stuff)
slide-20
SLIDE 20

What’s In and What’s Out

  • Cleanup
  • E.g. fewer cultures
  • E.g. fewer overloads here and there
  • Still being hashed out

20

slide-21
SLIDE 21

Command line fun: DNX, DNU, DNVM

21

slide-22
SLIDE 22

Why Command Line???

  • Automation
  • Cross platform
  • Visual Studio independence
  • Well worth learning

22

slide-23
SLIDE 23

DNX Runtime

Application

Frameworks (MVC, WebAPI, 3rd party) & OWIN middleware DNX CoreCLR FullCLR Mono

slide-24
SLIDE 24

DNX

  • Command line for all things ASP.NET 5
  • .NET Version Manager (dnvm)
  • .NET Development UItility (dnu)
  • .NET Execution Environment (dnx)
slide-25
SLIDE 25

Demo – YO, DNVM, DNU and DNX

slide-26
SLIDE 26

project.json

{ "dependencies": { "Microsoft.AspNet.Server.IIS" : "1.0.0-alpha2", "Microsoft.AspNet.Server.WebListener" : "1.0.0- alpha2", "Microsoft.AspNet.Owin": "1.0.0-alpha2", "Nancy" : “1.2.0" }, "configurations" : { “dnx451" : { }, “dnxcore50" : { } } }

slide-27
SLIDE 27

project.json

DOES NOT LIST ALL FILES IN PROJECT

slide-28
SLIDE 28

DNX, DNU, DNVM

  • No ties to

Visual Studio

  • Point-in-case:

atom-omnisharp

slide-29
SLIDE 29

ASP.NET 5 Pipeline

slide-30
SLIDE 30

ASP.NET 5: Pipeline

30

Kestrel Throttling Middleware OAuth Middleware Application

slide-31
SLIDE 31

Middleware

  • Middleware transforms the request and response
  • Takes a context in
  • Can call next step in pipeline
  • Or not
  • Uniform interface

31

slide-32
SLIDE 32

ASP.NET 5: Pipeline

32

Kestrel Throttling Middleware OAuth Middleware Application

slide-33
SLIDE 33

OWIN: The Standard

  • Several years in prod already
  • Used (semi) widely
  • Implemented by
  • Katana
  • Nowin
  • ASP.NET 5,…
  • Implemented by MVC, Nancy, Suave, …

33

slide-34
SLIDE 34

OWIN: Middleware Ecosystem

  • Security:
  • Oauth, Twitter, Facebook, Google, …
  • ClaimsTranformations
  • RequireSSL
  • ScopeValidation
  • Web:
  • Routing
  • Limits
  • Sitemap
  • StaticFiles
  • Monitoring
  • Raygun
  • Serilog

34

slide-35
SLIDE 35

OWIN Middleware - As lambda

35

app.UseOwin(buildFunc => buildFunc(next => async ctx => { var stopWatch = new Stopwatch(); stopWatch.Start(); await next(ctx); WriteLine("Action execution time: " + stopWatch.ElapsedMilliseconds); }));

slide-36
SLIDE 36

Cross Platform

slide-37
SLIDE 37
slide-38
SLIDE 38

DEMO

DNX, MVC, WINDOWS, LINUX

slide-39
SLIDE 39