Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introducing ASP.NET 5

Introducing ASP.NET 5

ASP.NET 5 is as big step forward as it was switching from "classic ASP" to ASP.NET in 2002.

Deep Focus

January 22, 2015
Tweet

More Decks by Deep Focus

Other Decks in Programming

Transcript

  1. All content contained herein is property of Deep Focus. ©2012

    All Rights Reserved. ALSO KNOWN AS (ASP.NET VNEXT) TECH BREAKFAST INTRODUCING ASP.NET 5 Anton Boichev JANUARY 21, 2015
  2. AGENDA 1.  Brief History 2.  New Features 3.  Naming Explained

    4.  Supported Runtimes 5.  New dependency management 6.  A New HTTP Pipeline 7.  Command-Line Tools 8.  Weekly Standup Videos 9.  Sources / Credits
  3. PAGE 3 25 JANUARY 2012 Brief History •  First  ASP.NET

     1.0  release  shipped  in  2002.   •  Evolved  from  Ac=ve  Server  Pages  (“classic  ASP”).   •  Introduced  .NET  Base  Class  Libraries,  designed  for  developers  used  to  write  business  desktop   applica=ons  (VB6,  Windows  Forms).   •  New  frameworks  added:  ASP.NET  MVC  (2008),  ASP.NET  Web  Pages  (2010),  Web  API,  SignalR.   ASP.NET  5  is  not  a  new  version,  it’s  a  new  technology  based  on   ASP.NET.     (sort  of  like  a  step  from  “classic  ASP”  to  ASP.NET  was  in  2002)  
  4. New Features •  Will  run  on  Linux  and  Mac!!!  (MicrosoS

     will  s=ll  support  it)   •  Side-­‐by-­‐side  installa=on.  Does  not  depend  on  globally  installed  components  or  GAC.   •  Does  not  require  a  build  step.  (Compiles  automa=cally  on  file  save,  feels  like  interpreted  language   like  PHP)   •  Designed  to  be  used  without  Visual  Studio  (uses  command  line  tools  instead).  Sublime  Text  and   others  has  syntax  plugin.   •  Can  be  hosted  on  IIS  or  other  webserver  or  inside  your  own  process.   •  Cloud-­‐op=mized.  Includes  new  lean  Core  CLR  (which  gets  deployed  with  your  app).    More  cloud  ready  features  like  cashing,  session  state,  diagnos=cs,  etc.   Should  work  best  with  Azure  cloud  services.   •  Open  source,  Apache  License  V2.0,  accep=ng  contribu=ons  (since  March  2012).  
  5. PAGE 5 25 JANUARY 2012 Naming confusion explained. ASP.NET  5

     a  new  name  of  the  whole  stack  (previously  known  as   ASP.NET  vNext).     Combines  ASP.NET  MVC  6,  WEB  API,  and  ASP.NET  Web  Pages(later).  
  6. Runtime support Support  mul=ple  cross-­‐pla^orm  run=me.   •  MicrosoH  .NET

     Framework  CLR  –  full  featured  .NET  framework  which  includes  all  exis=ng   libraries.   •  A  new  .NET  Core  CLR  –  refactored  version  on  .NET  that  ships  as  set  of  NuGet  packages.  Runs   mul=ple  versions  side-­‐by-­‐side.  Exis=ng  libraries  must  be  recompiled  to  run  on  Core  CLR.   •  Mono  –  currently  enables  you  to  develop  on  Mac  and  Linux,  will  be  replaced  with  MicrosoS   supported  run=me  in  future.   CLR  stands  for  Common  Language  Run=me  –  a  system  where  .NET  languages  run.  (Similar  to  Java’s   JVM  or  Android’s  Dalvik,  Node’s  V8  JavaScript  Engine,  etc.)  
  7. New dependency management { "dependencies": { "Kestrel": "1.0.0-beta1", "Microsoft.AspNet.Diagnostics": "1.0.0-beta1",

    "Microsoft.AspNet.Hosting": "1.0.0-beta1", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta1", "Microsoft.AspNet.StaticFiles": "1.0.0-beta1" }, "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001", "kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004" }, "frameworks": { "aspnet50": {}, "aspnetcore50": {} } } project.json  replaces  .proj  file  
  8. A New HTTP Pipeline Uses  OWIN-­‐compa=ble  middleware  to  plug  in

     components   using Microsoft.AspNet.Builder; using Microsoft.AspNet.Routing; using Microsoft.Framework.DependencyInjection; namespace HelloMvc { public class Startup { public void Configure(IApplicationBuilder app) { app.UseErrorPage(); // dependency injection system automatically calls this app.UseServices(services => { services.AddMvc(); }); app.UseMvc(); app.UseWelcomePage(); } } }
  9. K Runtime Environment (KRE) •  It’s  unknown  what  “K”  stands

     for.   •  KRE  is  a  set  of  soSware  that  provides  everything  you  need  to  host  and  run  your  app.   Command  line  tools:   •  KVM  –  K  Version  Manager.  Lets  you  switch  between  versions  of  kre,  install  latest,  etc.   •  KPM  –  KRE  Package  Manager.  Uses  NuGet  feeds.  “kpm  restore”,  “kpm  pack”.   •  K  Command  –  entry  point  to  run  custom  commands.  Similar  to  npm  scripts  feature.  
  10. Nice feature: All Files in the Folder. Front-­‐end  people  will

     love  this:      All  files  under  the  project  directory  are  automaNcally  added  to  the  project.     You  can  exclude  files  from  compile  or  publish  in  project.json.    
  11. OS X: Install Homebrew if it is not already installed.

    Run command brew tap aspnet/k to tap the ASP.NET vNext related git repositories. If you had already tapped the repo for previous releases, run brew untap aspnet/k to delete the old commands and tap again to get the updated brew scripts. Run command brew install kvm to install KVM. This also automatically install the latest KRE package from https://www.nuget.org/api/v2 feed. Run command source kvm.sh on your terminal if your terminal cannot understand kvm. # Install yeoman npm install -g yo # Install the ASP.NET generator npm install -g generator-aspnet # Run the generator yo aspnet (if it doesn’t work – let’s just watch a video :) https://www.youtube.com/watch?v=qZDRhNw_TPI ) We’ll do it live: Get a feel of it by installing and running on Mac...
  12. Sources / Credits ¤  hfp://www.asp.net/vnext   ¤  hfps://github.com/aspnet/   ¤ 

    hfps://github.com/aspnet/home   ¤  hfps://github.com/ligershark/Kulture   ¤  hOps://www.youtube.com/playlist?list=PL0M0zPgJ3HSHTAAHOA3JQU4vOjXFquF   ¤  hOps://msdn.microsoH.com/en-­‐us/magazine/ee310108.aspx