Preview 3-670.pptx

Taking .NET Cross-Platform: Building .NET Applications on Linux and Mac

1.0x

Preview 3-670.pptx

Created 2 years ago

Duration 0:00:00
lesson view count 89
Taking .NET Cross-Platform: Building .NET Applications on Linux and Mac
Select the file type you wish to download
Slide Content
  1. Habib Heydarian (habibh@microsoft.com)

    Slide 1 - Habib Heydarian (habibh@microsoft.com)

    • Program Manager
    • .NET
    • Taking .NET Cross-Platform: Building .NET Server/Cloud Apps on Linux and OS X
    • 670
    • //build/ content is being presented by Microsoft Office Mix The video for this session will be available shortly
  2. I am not a lawyer, but…

    Slide 2 - I am not a lawyer, but…

    • The content of this presentation is subject to change!
    • We are starting this journey with you and would _love_ your feedback
    • The bits are raw, crunchy but tasty* (*depending on your definition of tasty)
  3. Hello World on Linux (Demo)

    Slide 3 - Hello World on Linux (Demo)

    • Ch1: The Why and What
    • Ch2: Acquisition and Setup
    • Ch3: Creating and Building an App
    • Ch4: Deploying an App to Linux
    • Ch5: Advanced Topics
    • Ch6: Wrap up
    • Today’s Journey
  4. Let’s Dive In: Hello World on Linux

    Slide 4 - Let’s Dive In: Hello World on Linux

    • Demo
  5. Running a .NET App from the Cmd Line

    Slide 5 - Running a .NET App from the Cmd Line

    • Run:
    • ./corerun HelloWorld.exe
    • // corerun is a native host which loads and runs the app
    • // On Windows, bootstrapping a .NET app is built into the OS
  6. Chapter 1: The Why and What

    Slide 6 - Chapter 1: The Why and What

  7. Slide 7

    • 64-bit JIT + SIMD
    • Garbage 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
    • WPF
    • ASP.NET
    • (4 & 5)
    • Windows Forms
    • ASP.NET 5
    • Universal
    • Windows Apps
    • CoreCLR
    • .NET Native
    • Base class libraries
    • NuGet packages
    • Libraries
    • Shared
    • .NET on Linux and OS X
  8. Slide 8

    • Why .NET on Linux?
    • For Developers: New workloads/technologies
    • For Organizations: New market opportunities
    • For CTOs: Platform diversification
    • For CTOs: Server consolidation in the cloud
  9. Customers can run .NET apps and services in a Linux environment for server/cloud scenarios

    Slide 9 - Customers can run .NET apps and services in a Linux environment for server/cloud scenarios

    • First class support in VS for developing & deploying .NET apps to Linux environments, including Docker, as well as the ability to remotely debug .NET apps running on Linux.
    • OS X users can edit, compile and debug their .NET code on their Mac using Visual Studio Code (or their favorite editor).
    • .NET Core is open source with the entire source code on GitHub
    • Benefits for Developers
  10. Chapter 2: Acquisition and Setup

    Slide 10 - Chapter 2: Acquisition and Setup

  11. Slide 11

    • Acquisition Options (How do I get the bits?)
    • Development
    • Development/Deployment
    • .NET Core already installed as part of VS2015 RC
    • Download & install tar file
    • Download & install tar file
    • Use Homebrew formula on GitHub
    • Create VM on Azure Marketplace
    • Use Dockerfile on
    • Docker
    • Hub
    • (coming)
    • Clone repo on GitHub and build from source (advanced)
  12. Installing & running .NET on OS X using Homebrew

    Slide 12 - Installing & running .NET on OS X using Homebrew

    • brew tap aspnet/dnx
    • brew update
    • brew install dnvm
    • dnx . kestrel
    • // Homebrew is a popular package manager for Mac
    • // See https://github.com/aspnet/Home for details
    • After installing Homebrew (http://brew.sh):
  13. Installing & running .NET on Linux

    Slide 13 - Installing & running .NET on Linux

    • tar zxvf PartsUnlimited-demo-app-linux.tar.gz -C ~/
    • source ~/.dnx/dnvm/dnvm.sh
    • dnvm use 1.0.0-beta5-11624 -r coreclr -arch x64
    • dnx . kestrel
    • // A TAR (Tape ARchive) file is a standard format in *nix for packaging files. You can pack/unpack a tar file using the ‘tar’ command.
    • After downloading the tar file (*.tar.gz)
  14. Chapter 3: Creating and Building an App

    Slide 14 - Chapter 3: Creating and Building an App

  15. Development Environment Options

    Slide 15 - Development Environment Options

    • Visual Studio 2015 RC
    • Visual Studio Code
    • Visual Studio Code
    • Visual Studio Code
    • Choose your favorite editor, e.g. Sublime Text, Atom, etc.
    • Choose your favorite editor, Vi,
    • Emacs
    • , Atom, etc.
  16. Creating an ASP.NET 5 App in Visual Studio and Deploying it to a Docker Container

    Slide 16 - Creating an ASP.NET 5 App in Visual Studio and Deploying it to a Docker Container

    • Demo
  17. Running an ASP.NET 5 App on Linux

    Slide 17 - Running an ASP.NET 5 App on Linux

    • Run:
    • dnx . kestrel
    • View website:
    • http://localhost:5004
    • // dnx (.NET Execution Environment) contains the code required to bootstrap and run an ASP.NET 5 app
    • // kestrel is the cross-platform web server for ASP.NET 5
  18. .NET Core on Linux offers access to your existing data

    Slide 18 - .NET Core on Linux offers access to your existing data

    • SQL Server (remote access)
    • Azure SQL Database
    • No change to data access code
    • No data migration necessary
    • Additional data providers under consideration
    • Accessing Data from your App
    • Azure SQL Database
    • SQL Server
    • On premise
    • In cloud
  19. Accessing Data in an Azure SQL Database

    Slide 19 - Accessing Data in an Azure SQL Database

    • Demo
  20. Visual Studio Code 101

    Slide 20 - Visual Studio Code 101

    • Lightweight, cross-plat editor that runs on Windows, OS X and Linux
    • Provides IntelliSense, colorization, refactoring, etc.
    • Edit, compile and run app locally
    • Debugging support for .NET apps coming
  21. Chapter 4: Deploying an App to Linux

    Slide 21 - Chapter 4: Deploying an App to Linux

  22. Xcopy deployment to target environment

    Slide 22 - Xcopy deployment to target environment

    • On-premise
    • Azure IaaS (Linux VM)
    • Docker container
    • Windows container
    • Can use any deployment technology available on corresponding OS (Windows/Linux/OS X)
    • Can deploy .NET Core with the app
    • No need for machine-wide deployment of .NET
    • Deployment and Packaging
  23. Everything you need to evaluate .NET on Linux

    Slide 23 - Everything you need to evaluate .NET on Linux

    • .NET Core
    • ASP.NET 5
    • Parts Unlimited sample app
    • Linux VM on Azure Marketplace
  24. A Container is a

    Slide 24 - A Container is a

    • Lightweight VM
    • A unit of software delivery
    • Docker is the most popular container technology
    • Visual Studio 2015 RC provides support for publishing/managing Docker containers
    • Visual Studio 2015 RC Tools for Docker
    • Containers 101 (Oversimplified View)
  25. Chapter 5: Advanced Topics

    Slide 25 - Chapter 5: Advanced Topics

  26. Building .NET Core from Source (Windows Only)

    Slide 26 - Building .NET Core from Source (Windows Only)

    • Get CMake from http://www.cmake.org/download/
    • Git clone https://github.com/dotnet/coreclr.git
    • 3. Build via build.cmd. (make sure cmake is on the path)
    • 4. Once build is done, binaries are in bin\Product\Windows_NT.x64.Debug
    • Git clone https://github.com/dotnet/corefx.git
    • Build via build.cmd (from the root of the directory)
    • Once build is done, binaries are in \bin\Windows_NT.AnyCPU.Debug
    • Runtime (CoreCLR) - https://github.com/dotnet/coreclr
    • Framework (CoreFX) - https://github.com/dotnet/corefx
  27. The .NET Core Repo on GitHub

    Slide 27 - The .NET Core Repo on GitHub

  28. Home of the Octocat!

    Slide 28 - Home of the Octocat!

    • Also home of all .NET open source projects including .NET Core, ASP.NET 5, EF7, etc.
    • Visual Studio 2015 RC has support for GitHub
    • GitHub 101
  29. Calling Native APIs from .NET on Linux

    Slide 29 - Calling Native APIs from .NET on Linux

    • [DllImport("libc")]
    • private static extern int printf(string format);
    • printf("Hello, //BUILD 2015!\n");
    • // Same as Platform Invoke on Windows
  30. Chapter 6: Wrap up

    Slide 30 - Chapter 6: Wrap up

  31. .NET on Linux/OS X available for eval (64-bit only)

    Slide 31 - .NET on Linux/OS X available for eval (64-bit only)

    • Download tar failes for Linux and OS X
    • Evaluate using VM on Azure Marketplace
    • Evaluate using Dockerfile on Docker Hub
    • Create, edit and publish ASP.NET 5 apps using VS2015 RC or Visual Studio Code
    • Still to come
    • Remote debugging from VS2015
    • Local debugging from Visual Studio Code
    • MSBuild support (currently requires Mono)
    • Production readiness
    • Where are we today?
  32. .NET Core apps can run in a production Linux environment, including Docker containers (both on-prem and in the cloud)

    Slide 32 - .NET Core apps can run in a production Linux environment, including Docker containers (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 (Our Promise @ RTM)
  33. For the BUILD release, we have tested using Ubuntu 14.04.2 LTS

    Slide 33 - For the BUILD release, we have tested using Ubuntu 14.04.2 LTS

    • Your mileage might vary depending on distro
    • Other distros under consideration
    • Linux Distros Supported Tested for BUILD release
  34. Mono is a very popular platform for mobile .NET development on iOS and Android

    Slide 34 - Mono is a very popular platform for mobile .NET development on iOS and Android

    • It enjoys strong support from both the open source community as well Xamarin, Unity, etc.
    • While great for mobile scenarios, Mono wasn’t designed for server/cloud production-grade scenarios, i.e.
    • High throughput
    • Scale up/out
    • Mean Time To Failure (MTTF)
    • Ongoing collaboration on GitHub with the Mono community
    • But what about Mono?
  35. If creating a brand new app on Linux

    Slide 35 - If creating a brand new app on Linux

    • Start with Visual Studio 2015 RC ASP.NET 5 project templates
    • Evaluate Parts Unlimited ASP.NET sample on GitHub
    • If moving an existing app to Linux
    • Get a head start by transitioning app to ASP.NET 5 on Windows now
    • Once app is on ASP.NET 5, moving to Linux is trivial as ASP.NET 5 on Windows and Linux are identical
    • Getting Ready for .NET on Linux
  36. Download .NET Core + ASP.NET 5 (Linux | OS X)

    Slide 36 - Download .NET Core + ASP.NET 5 (Linux | OS X)

    • OS X: https://dotnet2015.blob.core.windows.net/binaries/PartsUnlimited-demo-app-darwin.tar.gz
    • Linux: 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 Preview
    • http://aka.ms/vslovesdocker
    • Evaluate .NET Core on Linux via the Azure VM Gallery
    • http://azure.microsoft.com/en-us/marketplace/
    • Check out the .NET Cross-Platform Tutorials
    • Create Cross-Platform .NET Apps
    • Learn about the Parts Unlimited Sample App
    • https://github.com/Microsoft/PartsUnlimited
    • Get involved and become a contributor to .NET Core!
    • http://github.com/dotnet
    • Call To Action
  37. We would love to hear from you!

    Slide 37 - We would love to hear from you!

    • @dotnet
    • dotnet
    • Blog
    • dotnet@microsoft.com
    • UserVoice
    • MSDN Forums
  38. Backup

    Slide 39 - Backup

  39. .NET Core on Windows vs Linux/OS X

    Slide 40 - .NET Core on Windows vs Linux/OS X

    • Feature
    • Windows
    • Linux / OS X
    • Web Server
    • IIS or kestrel
    • kestrel
    • IDE/Editor
    • Visual Studio
    • Visual Studio (remote development)
    • Emacs
    • Vi
    • Sublime
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
  40. Insert Session Code Here

    Slide 41 - Insert Session Code Here

    • Title of presentation
    • Name goes here
    • Position title goes here
    • Session title goes here
  41. Slide 42

    • Color palette and tools
    • Lead and accent colors have been formatted into this template.
    • In general, usewhite or dark blue for all slide backgrounds.
    • When building other graphics like tables and charts, please utilize the color palette provided within this template. The first 6 colors in the sub-tiles to the right.
    • RGB
    • 255 255 255
    • RGB
    • 0 24 143
    • RGB
    • 16 124 16
    • RGB
    • 227 0 140
    • RGB
    • 186 216 10
    • RGB
    • 0 178 148
    • RGB
    • 232 17 35
    • RGB
    • 255 185 0
    • RGB
    • 255 140 0
    • RGB
    • 180 160 255
    • RGB
    • 0 24 143
    • RGB
    • 0 188 242
    • //build/ template color palette and Windows brand colors
    • //build/ template background colors
    • Presentation tools
    • Find Photography, device renders and images, logos, and more here
    • Additional Microsoft brand images here (click ‘browse photography’ at top right)
  42. Color

    Slide 43 - Color

    • Content layouts
    • Demo and divider slides
    • Charts and code
    • Screenshots
    • Agenda slide
  43. Content slides

    Slide 44 - Content slides

  44. Titles are 48pt Segoe UI Light and sentence case. They do not use periods.

    Slide 45 - Titles are 48pt Segoe UI Light and sentence case. They do not use periods.

    • All text 28pt and above (including this content) is in Segoe UI Light. The smallest font you should use is 14pt, and in Segoe UI (body).
    • Second level not bulleted, 14pt Segoe UI (body) like this.
    • Multiple bullets would look like this.
    • Third level are bullets, like this.
    • Font is white (RGB 255,255,255) on dark blue slides.
    • Typography (color back option)
    • This could be a pithy summary of your slide content, or a single phrase to describe the main idea.
  45. Titles are 48pt Segoe UI Light and sentence case. They do not use periods.

    Slide 46 - Titles are 48pt Segoe UI Light and sentence case. They do not use periods.

    • All text 28pt and above (including this content) is in Segoe UI Light. The smallest font you should use is 14pt, and in Segoe UI (body).
    • Second level not bulleted, 14pt Segoe UI (body) like this.
    • Multiple bullets would look like this.
    • Third level are bullets, like this.
    • Font is gray (RGB 64,64,64) on white slides.
    • Typography
    • This could be a pithy summary of your slide content, or a single phrase to describe the main idea
  46. Special emphasis content, like a quote or statement, can appear in this location on the slide, at 48pt. Avoid running text from one edge of the page to the other. Do not use this slide for bulleted content.

    Slide 47 - Special emphasis content, like a quote or statement, can appear in this location on the slide, at 48pt. Avoid running text from one edge of the page to the other. Do not use this slide for bulleted content.

  47. Text would go here.

    Slide 48 - Text would go here.

    • To add your own image, right click the thumbnail view of this slide and select New Slide.
    • Click the picture icon, as directed, to add a new image.
    • Picture shape with title
  48. Use the Format Shape menu to change the color of the shape.

    Slide 49 - Use the Format Shape menu to change the color of the shape.

    • This text box will automatically center to align beside the color shape.
    • Color shapes can hold messaging
  49. Color back option.

    Slide 50 - Color back option.

    • Use the Format Shape menu to change the color of the shape.
    • This text box will automatically center to align beside the color shape.
    • Color shapes can hold messaging
  50. Demo title (use for demo intros)

    Slide 51 - Demo title (use for demo intros)

  51. Single device preferred angle. This is another option for displaying a hardware image that sits at an angle.

    Slide 52 - Single device preferred angle. This is another option for displaying a hardware image that sits at an angle.

  52. Charts and code (this is a divider slide)

    Slide 53 - Charts and code (this is a divider slide)

  53. Charts

    Slide 54 - Charts

    • For content: Type is what articulates the message. Text doesn’t need to be bulleted. Text size can reinforce and impact.
  54. Charts

    Slide 55 - Charts

    • For content: Type is what articulates the message. Text doesn’t need to be bulleted. Text size can reinforce and impact.
  55. Table

    Slide 56 - Table

    • This is a content box, always 24pts and sentence case.
    • Column 1
    • Column 2
    • Column 3
    • Column 4
    • Column 5
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
    • Text
  56. Diagram with text

    Slide 57 - Diagram with text

    • This is a content box, always 24pts and sentence case.
    • Media Foundation
    • Playback/Preview
    • (Media Engine)
    • Windows Style App
    • Capture
    • (Capture Engine)
    • Streaming
    • (Sharing Engine)
    • Transcode
    • Audio/Video
    • Source
    • Video
    • Decoder
    • Video
    • Effect 1
    • Video
    • Encoder
    • Video
    • Effect N
    • Audio/Video
    • Sink
    • Audio
    • Decoder
    • Audio
    • Effect 1
    • Audio
    • Encoder
    • Audio
    • Effect N
    • <audio src=“…”>
    • <video src=“…”>
    • Windows Runtime (WinRT)
  57. Diagram without text

    Slide 58 - Diagram without text

    • Media Foundation
    • Playback/Preview
    • (Media Engine)
    • New Windows 8 app
    • Capture
    • (Capture Engine)
    • Streaming
    • (Sharing Engine)
    • Transcode
    • Audio/Video
    • Source
    • Video
    • Decoder
    • Video
    • Effect 1
    • Video
    • Encoder
    • Video
    • Effect N
    • Audio/Video
    • Sink
    • Audio
    • Decoder
    • Audio
    • Effect 1
    • Audio
    • Encoder
    • Audio
    • Effect N
    • <audio src=“…”>
    • <video src=“…”>
    • Windows Runtime (WinRT)
  58. Code content here in 24pt Consolas font. Always use this white slide for code.

    Slide 59 - Code content here in 24pt Consolas font. Always use this white slide for code.

    • Slide title here
  59. Screenshots

    Slide 60 - Screenshots

  60. Use this slide to list resources, white papers, videos and links.

    Slide 63 - Use this slide to list resources, white papers, videos and links.

    • Let attendees know their next step after seeing this session.
    • Call to Action
  61. Use this slide to list resources, white papers, videos and links.

    Slide 64 - Use this slide to list resources, white papers, videos and links.

    • Let attendees know their next step after seeing this session.
    • Call to Action (color back option)
  62. Please Complete An Evaluation FormYour input is important!

    Slide 65 - Please Complete An Evaluation FormYour input is important!

    • SAMPLE
    • or
    • Required Slide
    • *delete this box when your slide is finalized
  63. Evaluate this session

    Slide 66 - Evaluate this session

    • SAMPLE
    • Required Slide
    • *delete this box when your slide is finalized
    • Speakers: This slide will be updated during the scrub process with a unique QR code. Attendees scan the QR code to access the eval for your session.