SlideShare une entreprise Scribd logo
1  sur  55
ASP.NET vNext
Intro and Hands-On
Agenda
Introduction and my opinions
Break + sandwiches
Hack
About me
Christian Horsdal
Independent Consultant
www.horsdal-consult.dk
c.horsdal@gmail.com
@chr_horsdal
Highlights
K runtime
Modularized .NET
Bin deploy
OWIN
Less dependent on Visual Studio
ASP.NET 12 Years Ago
IIS
.NET BCL
ASP.NET
HTTP
Modules
ASP.NET WebForms
HTTP
Handlers
Request
pipeline
HTTP
Context
Caching Session
State
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
ASP.NET – things not in Vnext
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
ASP.NET vNext – Guiding Principles
No dependency on System.Web
this is huge
Cross platform
Low friction
(this is my interpretation)
No System.Web
The System.Web namespace supplies classes and
interfaces that enable browser-server communication.
This namespace includes the HttpRequest class,
which provides extensive information about the current
HTTP request; the HttpResponse class, which
manages HTTP output to the client; and the
HttpServerUtility class, which provides access to
server-side utilities and processes. System.Web also
includes classes for cookie manipulation, file transfer,
exception information, and output cache control.
No System.Web
System.Web is at the very core of ASP.NET
Context
Request
Response
Session
Pipeline (that nasty global.asax stuff)
WebForms is intimately coupled to System.Web
No System.Web
MVC is not (so) tightly coupled to System.Web
Nor is WebAPI
No System.Web
Your MVC/WebAPI project may be, though
HttpContext, HttpRequest, HttpResponse
SessionState
Caching
No System.Web
Unless you want to…
Because legacy code
Because WebForms
Which still will improved on
ASP.NET – and things changes in Vnext
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
MVC + WebAPI
…will be unified
One controller type
Micorsoft.AspNet.Mvc.Controller
Or POCO controllers
MVC + WebAPI
One depedency injection solution
…registering ”services” during startup.
…inject in all
…including SignalR
MVC + WebAPI
Poke around in code
ASP.NET – and things changed in Vnext
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
Cloud Optimized Framework
Because cloud. CLOUD. CLOUD
Trimmed down
Opt-in to more through NuGets
Not in GAC
Framework not in GAC
Bin deploy
Side-by-side deploy
Good or bad for operations?
ASP.NET – and things changed in Vnext
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
Detour: OWIN
Applicaiton
Middleware
Middleware
Server
Middleware
Middleware
IDictionary<string, object>
OWIN
using AppFunc =
Func<IDictionary<string, object>, // Environment
Task>; // Done
OWIN – Request Environment
Required Key Name
Yes "owin.RequestBody"
Yes "owin.RequestHeaders"
Yes "owin.RequestMethod"
Yes "owin.RequestPath"
Yes "owin.RequestPathBase"
Yes "owin.RequestProtocol"
Yes "owin.RequestQueryString"
Yes "owin.RequestScheme"
OWIN – Response Environment
Required Key Name
Yes "owin.ResponseBody"
Yes "owin.ResponseHeaders"
No "owin.ResponseStatusCode"
No "owin.ResponseReasonPhrase"
No
"owin.ResponseProtocol"
OWIN in vNext
public class Startup
{
public void Configure(IBuilder app)
{
app.UseOwin(x => x.UseNancy());
}
}
OWIN in vNext
public class Startup
{
public void Configure(IBuilder app)
{
var buildFunc = app.UseOwin();
buildFunc(next => MyApp);
}
public Task MyApp(IDictionary<string, object> environment)
{
var responseText = "Hello World";
var responseBytes = Encoding.UTF8.GetBytes(responseText);
var responseStream = (Stream)environment["owin.ResponseBody"];
var responseHeaders = (IDictionary<string, string[]>)environment["owin.ResponseHeaders"]
responseHeaders["Content-Length"] =
new string[] { responseBytes.Length.ToString(CultureInfo.InvariantCulture) };
responseHeaders["Content-Type"] = new string[] { "text/plain" };
return responseStream.WriteAsync(responseBytes, 0, responseBytes.Length);
}
}
OWIN in vNext
public class Startup
{
public void Configure(IBuilder app)
{
app.UseOwin(x => x.UseNancy());
}
}
Startup.cs
Choose frameworks
MVC
SignalR
Third party
Setup OWIN pipeline
Startup.cs
Read configuration
Format is configurable, default json
Setup DI
Across everything
Startup.cs
Poke around in code
ASP.NET vNEXT
K Runtime
Command line for all things vNext
Or so it seems it will be
K Version Manager (kvm)
K Package Manager (kpm)
K Runtime Environment (kre)
K
K Runtime
Application
Frameworks (MVC, WebAPI, 3rd party) & OWIN middleware
KRE
CoreCLR FullCLR Mono
K Version Manager
PS C:projectsvNext-playHelloNancy> kvm list
Active Version Runtime Architecture Location
------ ------- ------- ------------ --------
1.0.0-alpha2 svr50 x86 C:Userschors_000.krepackages
1.0.0-alpha2 svrc50 x86 C:Userschors_000.krepackages
* 1.0.0-alpha3-10201 svr50 x86 C:Userschors_000.krepackages
PS C:projectsvNext-playHelloNancy> kvm use 1.0.0-alpha3*
Adding C:Userschors_000.krepackagesKRE-svr50-x86.1.0.0-alpha3*bin to process PATH
K Version Manager
Install KREs
Upgrade KREs
Set KRE per process
I.e. per powershell window
K Package Manager
Restores NuGets
But slightly smarter – kinda
Packages application
Detour: project.json
Superseedes package.config
Superseedes .csproj
{
"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" : "0.24-Pre1412"
},
"configurations" : {
"net451" : { },
"k10" : { }
}
}
project.json
Projects are NuGet or class libraries
Same syntax
Interchangeable
More or less no difference
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" : "0.24-Pre1412"
},
"configurations" : {
"net451" : { },
"k10" : { }
}
}
project.json
DOES NOT LIST ALL FILES IN PROJECT
project.json
Commands:
Arbitrary powershell
No more weird MSBuild mockery (I hope)
{
"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" : "0.24-Pre1412"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener
--server.urls http://localhost:5000"
},
"configurations" : {
K
Command line for KRE
Executes commands from project.json
In context of a KRE
K + Roslyn
= dynamic compilation of entire site
K, KPM, KVM, KRE
No ties to Visual Studio
Point-in-case: Kulture
Highlights
K runtime
Modularized .NET
Bin deploy
OWIN
Less dependent on Visual Studio
Why Do I Care?
More OWIN
Better opportunity for .NET OSS
OWIN Middleware eco system will blosson
 Nice modular way of working
Why Do I Care?
Modularized .NET + bin deploy
Smaller footprint on disk and memory (!)
Faster development from MS on some parts
Side-by-side on different versions
Why Do I Care?
K and cross platform:
Broader potential developer crowd
K as enabler for own tooling
K as enabler for 3rd party / OSS tooling
(and I’m not thinking about Jetbrains)
Break
…and sandwiches
Visual Studio 14 CTP*
Everybody got this???
k
Goto https://github.com/aspnet/Home
Make sure you allow remote scripts
Run the crazy command
Exercise: URL shortener
Follow shortened url
HTTP GET “/shorts” Redirect to original URL
Submit URL to shorten
HTTP POST “/” Shorten, store, return shortened URL
Get front page
HTTP GET “/” Web page with a simple form
Storing shortened URLs
Common MongoHQ database
Code at:
https://gist.github.com/horsdal/cbbf50bcbf3ff0904477
See Facebook
Things to do a long the way
Play with dynamic compile
Switch KRE with kvm
Write some stupid OWIN middleware
Do the URL shortener in MVC
Do the URL shortener in raw OWIN
K pack your app and move it
Add dependency to project.json, save and watch projects references
If CTP3 add xUnit test project as ASP.NET vNEXT class lib

Contenu connexe

Tendances

0-60 with Goliath: Building High Performance Ruby Web-Services
0-60 with Goliath: Building High Performance Ruby Web-Services0-60 with Goliath: Building High Performance Ruby Web-Services
0-60 with Goliath: Building High Performance Ruby Web-Services
Ilya Grigorik
 
Spring Boot & WebSocket
Spring Boot & WebSocketSpring Boot & WebSocket
Spring Boot & WebSocket
Ming-Ying Wu
 
0-60 with Goliath: High performance web services
0-60 with Goliath: High performance web services0-60 with Goliath: High performance web services
0-60 with Goliath: High performance web services
Ilya Grigorik
 

Tendances (20)

Gruntwork Executive Summary
Gruntwork Executive SummaryGruntwork Executive Summary
Gruntwork Executive Summary
 
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
 
VCL template abstraction model and automated deployments to Fastly
VCL template abstraction model and automated deployments to FastlyVCL template abstraction model and automated deployments to Fastly
VCL template abstraction model and automated deployments to Fastly
 
No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9No callbacks, No Threads - Cooperative web servers in Ruby 1.9
No callbacks, No Threads - Cooperative web servers in Ruby 1.9
 
Web Development with NodeJS
Web Development with NodeJSWeb Development with NodeJS
Web Development with NodeJS
 
Design & Performance - Steve Souders at Fastly Altitude 2015
Design & Performance - Steve Souders at Fastly Altitude 2015Design & Performance - Steve Souders at Fastly Altitude 2015
Design & Performance - Steve Souders at Fastly Altitude 2015
 
Tips for going fast in a slow world: Michael May at OSCON 2015
Tips for going fast in a slow world: Michael May at OSCON 2015Tips for going fast in a slow world: Michael May at OSCON 2015
Tips for going fast in a slow world: Michael May at OSCON 2015
 
0-60 with Goliath: Building High Performance Ruby Web-Services
0-60 with Goliath: Building High Performance Ruby Web-Services0-60 with Goliath: Building High Performance Ruby Web-Services
0-60 with Goliath: Building High Performance Ruby Web-Services
 
WebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! FrameworkWebSockets wiith Scala and Play! Framework
WebSockets wiith Scala and Play! Framework
 
Composable and streamable Play apps
Composable and streamable Play appsComposable and streamable Play apps
Composable and streamable Play apps
 
Beyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic AnalysisBeyond Breakpoints: A Tour of Dynamic Analysis
Beyond Breakpoints: A Tour of Dynamic Analysis
 
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
Handling 10k requests per second with Symfony and Varnish - SymfonyCon Berlin...
 
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
Mitigating Security Threats with Fastly - Joe Williams at Fastly Altitude 2015
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
 
Hackingtomcat
HackingtomcatHackingtomcat
Hackingtomcat
 
Spring Boot & WebSocket
Spring Boot & WebSocketSpring Boot & WebSocket
Spring Boot & WebSocket
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
 
MongoDB World 2019: Becoming an Ops Manager Backup Superhero!
MongoDB World 2019: Becoming an Ops Manager Backup Superhero!MongoDB World 2019: Becoming an Ops Manager Backup Superhero!
MongoDB World 2019: Becoming an Ops Manager Backup Superhero!
 
0-60 with Goliath: High performance web services
0-60 with Goliath: High performance web services0-60 with Goliath: High performance web services
0-60 with Goliath: High performance web services
 
Cloud Foundry, Spring and Vaadin
Cloud Foundry, Spring and VaadinCloud Foundry, Spring and Vaadin
Cloud Foundry, Spring and Vaadin
 

En vedette

En vedette (6)

Nancy + rest mow2012
Nancy + rest   mow2012Nancy + rest   mow2012
Nancy + rest mow2012
 
簡報2
簡報2簡報2
簡報2
 
Campus days 2014 owin
Campus days 2014 owinCampus days 2014 owin
Campus days 2014 owin
 
Middleware webnextconf - 20152609
Middleware   webnextconf - 20152609Middleware   webnextconf - 20152609
Middleware webnextconf - 20152609
 
Intro to.net core 20170111
Intro to.net core   20170111Intro to.net core   20170111
Intro to.net core 20170111
 
Consolidating services with middleware - NDC London 2017
Consolidating services with middleware - NDC London 2017Consolidating services with middleware - NDC London 2017
Consolidating services with middleware - NDC London 2017
 

Similaire à ASP.NET vNext ANUG 20140817

Similaire à ASP.NET vNext ANUG 20140817 (20)

Node.js introduction
Node.js introductionNode.js introduction
Node.js introduction
 
OWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIISOWIN and Katana Project - Not Only IIS - NoIIS
OWIN and Katana Project - Not Only IIS - NoIIS
 
SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)SharePoint Client Object Model (CSOM)
SharePoint Client Object Model (CSOM)
 
Introduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.comIntroduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.com
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
Getting Started with ASP.NET Core 1.0 (formerly ASP.NET 5)
 
Philly Tech Fest Iis
Philly Tech Fest IisPhilly Tech Fest Iis
Philly Tech Fest Iis
 
OWIN Why should i care?
OWIN Why should i care?OWIN Why should i care?
OWIN Why should i care?
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
Introduction to OWIN
Introduction to OWINIntroduction to OWIN
Introduction to OWIN
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6Learning ASP.NET 5 and MVC 6
Learning ASP.NET 5 and MVC 6
 
Mini-Training Owin Katana
Mini-Training Owin KatanaMini-Training Owin Katana
Mini-Training Owin Katana
 
Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014Building an aws sdk for Perl - Granada Perl Workshop 2014
Building an aws sdk for Perl - Granada Perl Workshop 2014
 
Running Microservices on AWS Elastic Beanstalk
Running Microservices on AWS Elastic BeanstalkRunning Microservices on AWS Elastic Beanstalk
Running Microservices on AWS Elastic Beanstalk
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
 
Just Another Word Press Weblog But More Cloudy
Just Another Word Press Weblog   But More CloudyJust Another Word Press Weblog   But More Cloudy
Just Another Word Press Weblog But More Cloudy
 

Plus de Christian Horsdal

Nancy - A Lightweight .NET Web Framework
Nancy - A Lightweight .NET Web FrameworkNancy - A Lightweight .NET Web Framework
Nancy - A Lightweight .NET Web Framework
Christian Horsdal
 
DCI ANUG - 24th November 2010
DCI ANUG - 24th November 2010DCI ANUG - 24th November 2010
DCI ANUG - 24th November 2010
Christian Horsdal
 
DCI - ANUG 24th November 2010
DCI - ANUG 24th November 2010DCI - ANUG 24th November 2010
DCI - ANUG 24th November 2010
Christian Horsdal
 

Plus de Christian Horsdal (9)

Testing microservices.ANUG.20230111.pptx
Testing microservices.ANUG.20230111.pptxTesting microservices.ANUG.20230111.pptx
Testing microservices.ANUG.20230111.pptx
 
Scoping microservices.20190917
Scoping microservices.20190917Scoping microservices.20190917
Scoping microservices.20190917
 
Event sourcing anug 20190227
Event sourcing anug 20190227Event sourcing anug 20190227
Event sourcing anug 20190227
 
Lightweight Approach to Building Web APIs with .NET
Lightweight Approach to Building Web APIs with .NETLightweight Approach to Building Web APIs with .NET
Lightweight Approach to Building Web APIs with .NET
 
Three Other Web Frameworks. All .NET. All OSS. One Hour. Go
Three Other Web Frameworks. All .NET. All OSS. One Hour. GoThree Other Web Frameworks. All .NET. All OSS. One Hour. Go
Three Other Web Frameworks. All .NET. All OSS. One Hour. Go
 
Four .NET Web Frameworks in Less Than an Hour
Four .NET Web Frameworks in Less Than an HourFour .NET Web Frameworks in Less Than an Hour
Four .NET Web Frameworks in Less Than an Hour
 
Nancy - A Lightweight .NET Web Framework
Nancy - A Lightweight .NET Web FrameworkNancy - A Lightweight .NET Web Framework
Nancy - A Lightweight .NET Web Framework
 
DCI ANUG - 24th November 2010
DCI ANUG - 24th November 2010DCI ANUG - 24th November 2010
DCI ANUG - 24th November 2010
 
DCI - ANUG 24th November 2010
DCI - ANUG 24th November 2010DCI - ANUG 24th November 2010
DCI - ANUG 24th November 2010
 

Dernier

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (20)

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 

ASP.NET vNext ANUG 20140817

  • 2. Agenda Introduction and my opinions Break + sandwiches Hack
  • 3. About me Christian Horsdal Independent Consultant www.horsdal-consult.dk c.horsdal@gmail.com @chr_horsdal
  • 4. Highlights K runtime Modularized .NET Bin deploy OWIN Less dependent on Visual Studio
  • 5. ASP.NET 12 Years Ago IIS .NET BCL ASP.NET HTTP Modules ASP.NET WebForms HTTP Handlers Request pipeline HTTP Context Caching Session State
  • 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
  • 7. ASP.NET – things not in Vnext 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
  • 8. ASP.NET vNext – Guiding Principles No dependency on System.Web this is huge Cross platform Low friction (this is my interpretation)
  • 9. No System.Web The System.Web namespace supplies classes and interfaces that enable browser-server communication. This namespace includes the HttpRequest class, which provides extensive information about the current HTTP request; the HttpResponse class, which manages HTTP output to the client; and the HttpServerUtility class, which provides access to server-side utilities and processes. System.Web also includes classes for cookie manipulation, file transfer, exception information, and output cache control.
  • 10. No System.Web System.Web is at the very core of ASP.NET Context Request Response Session Pipeline (that nasty global.asax stuff) WebForms is intimately coupled to System.Web
  • 11. No System.Web MVC is not (so) tightly coupled to System.Web Nor is WebAPI
  • 12. No System.Web Your MVC/WebAPI project may be, though HttpContext, HttpRequest, HttpResponse SessionState Caching
  • 13. No System.Web Unless you want to… Because legacy code Because WebForms Which still will improved on
  • 14. ASP.NET – and things changes in Vnext 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
  • 15. MVC + WebAPI …will be unified One controller type Micorsoft.AspNet.Mvc.Controller Or POCO controllers
  • 16. MVC + WebAPI One depedency injection solution …registering ”services” during startup. …inject in all …including SignalR
  • 17. MVC + WebAPI Poke around in code
  • 18. ASP.NET – and things changed in Vnext 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
  • 19. Cloud Optimized Framework Because cloud. CLOUD. CLOUD Trimmed down Opt-in to more through NuGets Not in GAC
  • 20. Framework not in GAC Bin deploy Side-by-side deploy Good or bad for operations?
  • 21. ASP.NET – and things changed in Vnext 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
  • 23. OWIN using AppFunc = Func<IDictionary<string, object>, // Environment Task>; // Done
  • 24. OWIN – Request Environment Required Key Name Yes "owin.RequestBody" Yes "owin.RequestHeaders" Yes "owin.RequestMethod" Yes "owin.RequestPath" Yes "owin.RequestPathBase" Yes "owin.RequestProtocol" Yes "owin.RequestQueryString" Yes "owin.RequestScheme"
  • 25. OWIN – Response Environment Required Key Name Yes "owin.ResponseBody" Yes "owin.ResponseHeaders" No "owin.ResponseStatusCode" No "owin.ResponseReasonPhrase" No "owin.ResponseProtocol"
  • 26. OWIN in vNext public class Startup { public void Configure(IBuilder app) { app.UseOwin(x => x.UseNancy()); } }
  • 27. OWIN in vNext public class Startup { public void Configure(IBuilder app) { var buildFunc = app.UseOwin(); buildFunc(next => MyApp); } public Task MyApp(IDictionary<string, object> environment) { var responseText = "Hello World"; var responseBytes = Encoding.UTF8.GetBytes(responseText); var responseStream = (Stream)environment["owin.ResponseBody"]; var responseHeaders = (IDictionary<string, string[]>)environment["owin.ResponseHeaders"] responseHeaders["Content-Length"] = new string[] { responseBytes.Length.ToString(CultureInfo.InvariantCulture) }; responseHeaders["Content-Type"] = new string[] { "text/plain" }; return responseStream.WriteAsync(responseBytes, 0, responseBytes.Length); } }
  • 28. OWIN in vNext public class Startup { public void Configure(IBuilder app) { app.UseOwin(x => x.UseNancy()); } }
  • 30. Startup.cs Read configuration Format is configurable, default json Setup DI Across everything
  • 33. K Runtime Command line for all things vNext Or so it seems it will be K Version Manager (kvm) K Package Manager (kpm) K Runtime Environment (kre) K
  • 34. K Runtime Application Frameworks (MVC, WebAPI, 3rd party) & OWIN middleware KRE CoreCLR FullCLR Mono
  • 35. K Version Manager PS C:projectsvNext-playHelloNancy> kvm list Active Version Runtime Architecture Location ------ ------- ------- ------------ -------- 1.0.0-alpha2 svr50 x86 C:Userschors_000.krepackages 1.0.0-alpha2 svrc50 x86 C:Userschors_000.krepackages * 1.0.0-alpha3-10201 svr50 x86 C:Userschors_000.krepackages PS C:projectsvNext-playHelloNancy> kvm use 1.0.0-alpha3* Adding C:Userschors_000.krepackagesKRE-svr50-x86.1.0.0-alpha3*bin to process PATH
  • 36. K Version Manager Install KREs Upgrade KREs Set KRE per process I.e. per powershell window
  • 37. K Package Manager Restores NuGets But slightly smarter – kinda Packages application
  • 38. Detour: project.json Superseedes package.config Superseedes .csproj { "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" : "0.24-Pre1412" }, "configurations" : { "net451" : { }, "k10" : { } } }
  • 39. project.json Projects are NuGet or class libraries Same syntax Interchangeable More or less no difference
  • 40. 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" : "0.24-Pre1412" }, "configurations" : { "net451" : { }, "k10" : { } } }
  • 41. project.json DOES NOT LIST ALL FILES IN PROJECT
  • 42. project.json Commands: Arbitrary powershell No more weird MSBuild mockery (I hope) { "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" : "0.24-Pre1412" }, "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000" }, "configurations" : {
  • 43. K Command line for KRE Executes commands from project.json In context of a KRE
  • 44. K + Roslyn = dynamic compilation of entire site
  • 45. K, KPM, KVM, KRE No ties to Visual Studio Point-in-case: Kulture
  • 46. Highlights K runtime Modularized .NET Bin deploy OWIN Less dependent on Visual Studio
  • 47. Why Do I Care? More OWIN Better opportunity for .NET OSS OWIN Middleware eco system will blosson  Nice modular way of working
  • 48. Why Do I Care? Modularized .NET + bin deploy Smaller footprint on disk and memory (!) Faster development from MS on some parts Side-by-side on different versions
  • 49. Why Do I Care? K and cross platform: Broader potential developer crowd K as enabler for own tooling K as enabler for 3rd party / OSS tooling (and I’m not thinking about Jetbrains)
  • 51. Visual Studio 14 CTP* Everybody got this???
  • 52. k Goto https://github.com/aspnet/Home Make sure you allow remote scripts Run the crazy command
  • 53. Exercise: URL shortener Follow shortened url HTTP GET “/shorts” Redirect to original URL Submit URL to shorten HTTP POST “/” Shorten, store, return shortened URL Get front page HTTP GET “/” Web page with a simple form
  • 54. Storing shortened URLs Common MongoHQ database Code at: https://gist.github.com/horsdal/cbbf50bcbf3ff0904477 See Facebook
  • 55. Things to do a long the way Play with dynamic compile Switch KRE with kvm Write some stupid OWIN middleware Do the URL shortener in MVC Do the URL shortener in raw OWIN K pack your app and move it Add dependency to project.json, save and watch projects references If CTP3 add xUnit test project as ASP.NET vNEXT class lib