SlideShare a Scribd company logo
ASP.NET vNext
RICHARD CAUNT
Once Upon a Time…
 Classic ASP – December 1996
 ASP.NET 1.0 – January 2002 – Object Orientated
 ASP.NET 2.0 – November 2005 – New WebForms Controls
 ASP.NET 3.5 – November 2007 – WPF, WWF, WCF
 ASP.NET 4.0 – April 2010 – ASP.NET AJAX, LINQ
 ASP.NET 4.5 – August 2012 – Parallel Extensions
 ASP.NET 5.0 aka vNext – July 2015
2
Cons…
 Windows / IIS Only
 Fragmented Programing Model (Web API, Web Forms, MVC)
 Limited Dependency Injection
 System.Web (HttpContext) Reliance
 .NET Framework Administration
 Side-by-side Deployments
 Assembly Strong Naming
 Closed Source
 Heavy Pipeline
3
“
”
ASP.NET vNext is a leaner, more
modular, cross-platform, cloud
optimized and open source
framework.
SCOTT GUTHRIE
Lots Has Changed
4
Pros…
 Cross-platform – Windows, Mac and Linux
 Open Source – http://github.com/aspnet/Home
 Dependency Injection Everywhere
 Modular – Everything as Packages (even the CLR)
 Server-side NuGet Packages – Either as Binary or Source
 Hosting Options – IIS, Self-hosting => Docker
 Unified Programming Model
 Cloud-ready Environment Based Configuration (JSON)
 Performance – No System.Web Dependency
 Configurable Request Pipeline – UseIdentity(), UseMvc() etc
 Supports OWIN (Open Web Interfaces for .NET)
5
Architecture
https://github.com/aspnet/Home/wiki/DNX-structure
6
Runtime Environments
 .NET Core
 Small and lean footprint (modular)
 Deployable with the application
 Updatable without affecting OS/applications
 Cross-platform (Windows, Mac and Linux)
 http://github.com/dotnet/coreclr
 However, some functionality not available
 .NET Framework (“Desktop”)
 The framework as you currently know it – assemblies loaded from the
GAC
7
“
”
.NET Execution Environment (DNX)
The DNX is an SDK containing everything
needed to build and run an application,
including the CLR in the case of Core CLR. It
can be bin deployed with you application
and as such can be deployed side-by-side
with other applications on the server.
(Used to be called k)
8
DNX Tooling / Commands
 DNX (X for eXecution)
 Entry point to the runtime, i.e. used to run an application:
dnx <path to project.json> <command to run>
 Commands include run, web and build
 DNVM (VM for Version Manager)
 Runtime version manager
 Can fetch, install, upgrade and switch CLR
 DNU (U for Utility)
 Installs and restores packages for application
 Build and packages application for deployment
9
Demo
10
Solution Structure
global.json
 Configures the solution as a whole by:
 Designates which folders contain code
 Specifies DNX version
11
Solution Structure
References
 Same as before, but:
 Expanded to show different reference sets for
different runtime environments (Desktop / Core)
 Drill down into reference dependencies
 Server-side
12
Solution Structure
wwwroot
 Represents the actual root of the website when
running on a web server
 Should contain only static files required to render
the final page output (JS/CSS)
 Protects configuration files from hackers
13
Solution Structure
Dependencies
 Client-side version of References
 Bower – “A package manager for the web”
 Configured using bower.json
 Bower tasks run by Gulp using gulpfile.js
 NPM – Jack of all trades package manager
 Configured using package.json
14
Solution Structure
config.json
 New location and format for settings traditionally
kept in web.config and machine.config
 Not just limited to name/value pairs
 Configuration not just limited to one file and
JSON format, can source from:
 XML
 INI
 Database
15
Solution Structure
hosting.ini
 Configuration information used when self-hosting
an ASP.NET 5 website
 Specifies server type
 WebListener – Self-hosting
 Kestrel – Cross-platform
 Will change to be JSON based
16
Solution Structure
project.json
 Configure frameworks
 Manage server-side dependencies
 Configure compiler settings – Release/Debug
 Commands for DNX
 Scripts for pre/post-build/pack/restore
 Does not contain Visual Studio settings (.xproj)
17
Solution Structure
Startup.cs
 Simplistically – Replaces Global.asax
 Load configuration
 config.json
 Environment variables
 Configure dependency injection
 Configure pipeline / middleware
 UseMvc(), UseIdentity(), UseStaticFiles()
18
Demo
19
Further Topics
 Entity Framework 7
 No more .edmx files
 MVC 6
 Tag Helpers
 Project Migration
 Docker
20
Further Reading
 http://www.asp.net/vnext
 http://github.com/aspnet/Home/wiki
 http://www.codemag.com/article/1501061
 https://weblogs.asp.net/scottgu/introducing-asp-net-5
 http://blogs.msdn.com/b/webdev/archive/2014/06/17/dependenc
y-injection-in-asp-vnext.aspx
 http://wildermuth.com/2015/2/25/A_Look_at_ASP_NET_5_Part_1_-
_Getting_Started
 http://www.hanselman.com/blog/PublishingAnASPNET5AppToDock
erOnLinuxWithVisualStudio.aspx
21
Questions? 22

More Related Content

ASP.NET vNext

  • 2. Once Upon a Time…  Classic ASP – December 1996  ASP.NET 1.0 – January 2002 – Object Orientated  ASP.NET 2.0 – November 2005 – New WebForms Controls  ASP.NET 3.5 – November 2007 – WPF, WWF, WCF  ASP.NET 4.0 – April 2010 – ASP.NET AJAX, LINQ  ASP.NET 4.5 – August 2012 – Parallel Extensions  ASP.NET 5.0 aka vNext – July 2015 2
  • 3. Cons…  Windows / IIS Only  Fragmented Programing Model (Web API, Web Forms, MVC)  Limited Dependency Injection  System.Web (HttpContext) Reliance  .NET Framework Administration  Side-by-side Deployments  Assembly Strong Naming  Closed Source  Heavy Pipeline 3
  • 4. “ ” ASP.NET vNext is a leaner, more modular, cross-platform, cloud optimized and open source framework. SCOTT GUTHRIE Lots Has Changed 4
  • 5. Pros…  Cross-platform – Windows, Mac and Linux  Open Source – http://github.com/aspnet/Home  Dependency Injection Everywhere  Modular – Everything as Packages (even the CLR)  Server-side NuGet Packages – Either as Binary or Source  Hosting Options – IIS, Self-hosting => Docker  Unified Programming Model  Cloud-ready Environment Based Configuration (JSON)  Performance – No System.Web Dependency  Configurable Request Pipeline – UseIdentity(), UseMvc() etc  Supports OWIN (Open Web Interfaces for .NET) 5
  • 7. Runtime Environments  .NET Core  Small and lean footprint (modular)  Deployable with the application  Updatable without affecting OS/applications  Cross-platform (Windows, Mac and Linux)  http://github.com/dotnet/coreclr  However, some functionality not available  .NET Framework (“Desktop”)  The framework as you currently know it – assemblies loaded from the GAC 7
  • 8. “ ” .NET Execution Environment (DNX) The DNX is an SDK containing everything needed to build and run an application, including the CLR in the case of Core CLR. It can be bin deployed with you application and as such can be deployed side-by-side with other applications on the server. (Used to be called k) 8
  • 9. DNX Tooling / Commands  DNX (X for eXecution)  Entry point to the runtime, i.e. used to run an application: dnx <path to project.json> <command to run>  Commands include run, web and build  DNVM (VM for Version Manager)  Runtime version manager  Can fetch, install, upgrade and switch CLR  DNU (U for Utility)  Installs and restores packages for application  Build and packages application for deployment 9
  • 11. Solution Structure global.json  Configures the solution as a whole by:  Designates which folders contain code  Specifies DNX version 11
  • 12. Solution Structure References  Same as before, but:  Expanded to show different reference sets for different runtime environments (Desktop / Core)  Drill down into reference dependencies  Server-side 12
  • 13. Solution Structure wwwroot  Represents the actual root of the website when running on a web server  Should contain only static files required to render the final page output (JS/CSS)  Protects configuration files from hackers 13
  • 14. Solution Structure Dependencies  Client-side version of References  Bower – “A package manager for the web”  Configured using bower.json  Bower tasks run by Gulp using gulpfile.js  NPM – Jack of all trades package manager  Configured using package.json 14
  • 15. Solution Structure config.json  New location and format for settings traditionally kept in web.config and machine.config  Not just limited to name/value pairs  Configuration not just limited to one file and JSON format, can source from:  XML  INI  Database 15
  • 16. Solution Structure hosting.ini  Configuration information used when self-hosting an ASP.NET 5 website  Specifies server type  WebListener – Self-hosting  Kestrel – Cross-platform  Will change to be JSON based 16
  • 17. Solution Structure project.json  Configure frameworks  Manage server-side dependencies  Configure compiler settings – Release/Debug  Commands for DNX  Scripts for pre/post-build/pack/restore  Does not contain Visual Studio settings (.xproj) 17
  • 18. Solution Structure Startup.cs  Simplistically – Replaces Global.asax  Load configuration  config.json  Environment variables  Configure dependency injection  Configure pipeline / middleware  UseMvc(), UseIdentity(), UseStaticFiles() 18
  • 20. Further Topics  Entity Framework 7  No more .edmx files  MVC 6  Tag Helpers  Project Migration  Docker 20
  • 21. Further Reading  http://www.asp.net/vnext  http://github.com/aspnet/Home/wiki  http://www.codemag.com/article/1501061  https://weblogs.asp.net/scottgu/introducing-asp-net-5  http://blogs.msdn.com/b/webdev/archive/2014/06/17/dependenc y-injection-in-asp-vnext.aspx  http://wildermuth.com/2015/2/25/A_Look_at_ASP_NET_5_Part_1_- _Getting_Started  http://www.hanselman.com/blog/PublishingAnASPNET5AppToDock erOnLinuxWithVisualStudio.aspx 21