asp.net on mac, linux and the open-source culture

33

Upload: ricardo-fiel

Post on 24-Jan-2018

2.057 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: ASP.NET on Mac, Linux and the Open-Source culture
Page 2: ASP.NET on Mac, Linux and the Open-Source culture

ASP.NET  on Mac,  Linux  andthe Open-­‐Source cultureRicardo  Fiel

Page 3: ASP.NET on Mac, Linux and the Open-Source culture

About  me• Born  1978  in  Leiria• Dad  of  one,  Lucas,  4yr  • Started  programming  in  a  ZX  Spectrum• Graduated  from  ISEL,  Lisbon  Polytechnic• ~12  years  exp.  in  software  teams• Community  evangelist  • Noisy  guitar  player,  some  albums  out,  ~300  gigs

• Currently  CTO  @ RUPEAL                                @theplastictoy

http://[email protected]

Page 4: ASP.NET on Mac, Linux and the Open-Source culture
Page 5: ASP.NET on Mac, Linux and the Open-Source culture

Agenda1. Evolution  and  why  open-­‐source  matters2. Getting  up  and  running3. Going  live

Page 6: ASP.NET on Mac, Linux and the Open-Source culture

How  did  ASP.NET the  web  evolve?

Page 7: ASP.NET on Mac, Linux and the Open-Source culture
Page 8: ASP.NET on Mac, Linux and the Open-Source culture

This  used  to  be  simple!

Page 9: ASP.NET on Mac, Linux and the Open-Source culture

Challenge  – Frontend

Page 10: ASP.NET on Mac, Linux and the Open-Source culture

Challenge  – The  Server

Page 11: ASP.NET on Mac, Linux and the Open-Source culture

Diversification

Page 12: ASP.NET on Mac, Linux and the Open-Source culture

Our  story  – InvoiceXpress Architecture  +  Dev  Culture

Page 13: ASP.NET on Mac, Linux and the Open-Source culture

Collaboration  (Microservices +  Devops)

Page 14: ASP.NET on Mac, Linux and the Open-Source culture

Containers!!

Page 15: ASP.NET on Mac, Linux and the Open-Source culture

So,  what’s  ASP.NET  open-­‐source?

Page 16: ASP.NET on Mac, Linux and the Open-Source culture

64-­‐bit  JIT  +  SIMDGarbage  Collector

Runtime  components Compilers.NET  Compiler  Platform  (Roslyn)Languages  innovation

.NET Framework 4.6 .NET Core 5

Fully-­‐featured  and  integrated  .NET  libraries   and  runtime   for  Windows

Modular  and  optimized  .NET  libraries   and  runtimes

Base  class  librariesNuGet  packages

Libraries

.NET  on  Linux  and  OS  X

Page 17: ASP.NET on Mac, Linux and the Open-Source culture

.NET  Core  +  CoreCLR• .NET  Core:• CoreFX (libraries)  +  CoreCLR (small,  optimized  runtime)• Cross  platform:  Windows,  Linux,  Mac• Side  by  side  installation,  no  shared  code• Modular,  use  only  what  you  need• Xcopy deployments

• CoreCLR:• Runtime  implementation  for  .NET  Core• Includes  RyuJIT,  .NET  GC,  native  interop,  etc…

• Everything  is  open-­‐source  on  GitHub• EntityFramework 7  is  supported

Page 18: ASP.NET on Mac, Linux and the Open-Source culture

Building  ASP.NET  on  a  Mac

Page 19: ASP.NET on Mac, Linux and the Open-Source culture

Getting  up  and  runninghttps://github.com/aspnet/Home

• .NET  Core  already  installed  as  part  of  VS2015  RC

• Clone  repo  on  GitHub  and  build  from  source  (advanced)

• Download  installer• Use  Homebrew  formula  on  GitHub

• Manual   install

• Download  &  install  tar  file

• Create  VM  on  Azure  Marketplace

• Use  Dockerfile  on  Docker Hub

Page 20: ASP.NET on Mac, Linux and the Open-Source culture

Editors  and  IDEs  – OmniSharp community  effort

Let’s  focus  on  Yeoman  +  VS  Code

Page 21: ASP.NET on Mac, Linux and the Open-Source culture

Building  and  Running  – the  tools• dnvm (.NET  Version  Manager)• Run  multiple  versions  side  by  side• Same  concepts  as  rvm and  rbenv for  Ruby

• dnu (.NET  Development  Utility)• Build  and  publish• Manage  dependencies

• dnx (.NET  Execution  Environment)• Runs  web  and  console  apps  (non-­‐native)• For  web,  on  a  Mac,  uses  kestrel  web  server

Page 22: ASP.NET on Mac, Linux and the Open-Source culture

Demo  time!Generating  an  app  with  yeoman  and  running  it

Page 23: ASP.NET on Mac, Linux and the Open-Source culture

Building  and  Running  – the  tools  – RECAP!• dnvm (.NET  Version  Manager)• Run  multiple  versions  side  by  side• Same  concepts  as  rvm and  rbenv for  Ruby

• dnu (.NET  Development  Utility)• Build  and  publish• Manage  dependencies

• dnx (.NET  Execution  Environment)• Runs  web  and  console  apps  (non-­‐native)• For  web,  on  a  Mac,  uses  kestrel  web  server

# make sure we’re on the latest # enginednvm upgrade

# update dependenciesdnu restore

# build and rundnx web

Page 24: ASP.NET on Mac, Linux and the Open-Source culture

Anatomy  of  an  app• Project.json• Similar  to  node.js ‘package.json’• Target  frameworks,  dependencies,  commands,  scripts• A  DNX  app  is  basically  project.json and  a  startup.cs (or  other  name)  file

• Project.lock.json• Similar  to  rails    ‘Gemfile.lock’• Contains  the  dependency  tree  generated  by  ‘dnx restore’• Used  at  app  boot  time  

• Multiple  projects (aka  Solutions)• global.json file

• More  info: http://docs.asp.net/en/latest/dnx/projects.html

Page 25: ASP.NET on Mac, Linux and the Open-Source culture

Demo  time!Deploying  to  Azure  Web  Apps  and  Linux  VMs

Page 26: ASP.NET on Mac, Linux and the Open-Source culture

Last  words  and  testament

Page 27: ASP.NET on Mac, Linux and the Open-Source culture

Choosing  the  right  .NET  for  You• .NET  Framework

• Windows  only• Fully  featured• NOT  open  source

• .NET  Core• CoreFX (libraries)  +  CoreCLR (small,  optimized  runtime)• Cross  platform:  Windows,  Linux,  Mac• Open  source

• Mono• .NET  for  non-­‐Windows  platforms,  been  around  for  years• Community-­‐driven,  supported  by  Xamarin• Best  choice  for  mobile  apps,  BUT  not  ready  for  server/cloud  workloads• Open-­‐source

• More  Info:  https://docs.asp.net/en/latest/getting-­‐started/choosing-­‐the-­‐right-­‐dotnet.html

Page 28: ASP.NET on Mac, Linux and the Open-Source culture

• .NET  Core  apps  can  run  in  a  production   Linux  environment,   including  Dockercontainers   (both  on-­‐prem and  in  the  cloud)

• Developers   can  edit,  compile  and  debug  their  .NET  code  on  Mac  OS  X  using  Visual  Studio  Code  (or  their  favorite  editor).

• Apps  built  using  platform-­‐agnostic  features have  identical  behavior  on  Windows  and  x-­‐platform

• .NET  Core  brings  along  existing  .NET  cloud  ecosystem   of  libraries   to  Linux

• Microsoft  will  support,  service   and  maintain  .NET  on  Linux  like  any  other  Microsoft   product

Plan  of  Record  (Microsoft’s  Promise  @  RTM)

It  Will  Work!  J

Page 29: ASP.NET on Mac, Linux and the Open-Source culture

Call  to  Action!

Download  .NET  Core  +  ASP.NET  5 (Linux  |  OS  X)OS  X:  https://dotnet2015.blob.core.windows.net/binaries/PartsUnlimited-­‐demo-­‐app-­‐darwin.tar.gzLinux:  https://dotnet2015.blob.core.windows.net/binaries/PartsUnlimited-­‐demo-­‐app-­‐linux.tar.gz

Download  Visual  Studio  Code (Windows  |  Linux  |  OS  X)http://code.visualstudio.com

Download  Visual  Studio  2015  RC  Tools  for  Docker Previewhttp://aka.ms/vslovesdocker

Evaluate  .NET  Core  on  Linux  via  the  Azure  VM  Galleryhttp://azure.microsoft.com/en-­‐us/marketplace/

Check  out  the  .NET  Cross-­‐Platform  TutorialsCreate  Cross-­‐Platform  .NET  Apps

Learn  about  the  Parts  Unlimited Sample  Apphttps://github.com/Microsoft/PartsUnlimited

Get  involved  and  become  a  contributor  to  .NET  Core!http://github.com/dotnet

Page 30: ASP.NET on Mac, Linux and the Open-Source culture

Going  Deep

https://github.com/aspnet/Home/wiki/DNX-­‐structure

Page 31: ASP.NET on Mac, Linux and the Open-Source culture

Visual  Studio  Code

runtimes node.js, ASP.Net  5

languages  -­‐ basic*coloring,  brackets,  indent

CoffeeScript,  Python,  Ruby,  Jade,  Clojure, Java,  C++, R,  Go,  makefile,  shell,  powershell,  bat,  XML,  Markdown,  ...

languages  -­‐ better+ IntelliSense,  linting,  outline

JavaScript,  HTML,  CSS,  LESS,  SASS, JSON

languages  -­‐ best+ find all  refs,  refactoring

C#,  TypeScript

source  control git

task  running gulp,  grunt ...

Page 32: ASP.NET on Mac, Linux and the Open-Source culture

Calling  all  devs!  -­‐ December  10,  Lisbon

mergelisbon.com

Page 33: ASP.NET on Mac, Linux and the Open-Source culture

@theplastictoyhttp://[email protected]

Thank You!