64-bit JIT + SIMD Garbage Collector Runtime components Compilers.NET Compiler Platform (Roslyn)...
-
Upload
jade-miles -
Category
Documents
-
view
280 -
download
1
Transcript of 64-bit JIT + SIMD Garbage Collector Runtime components Compilers.NET Compiler Platform (Roslyn)...
Habib Heydarian ([email protected])Program Manager.NET
Taking .NET Cross-Platform: Building .NET Server/Cloud Apps on Linux and OS X
670
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)
• 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
Let’s Dive In: Hello World on LinuxDemo
Running a .NET App from the Cmd LineRun:./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
Chapter 1: The Why and What
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
WPF ASP.NET (4 & 5)
Windows Forms
ASP.NET 5 Universal Windows Apps
CoreCLR .NET Native
Base class librariesNuGet packages
Libraries
Shared
.NET on Linux and OS X
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
• 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
Chapter 2: Acquisition and Setup
Acquisition Options (How do I get the bits?)
• .NET Core already installed as part of VS2015 RC
• Clone repo on GitHub and build from source (advanced)
• Download & install tar file
• Use Homebrew formula on GitHub
• Download & install tar file
• Create VM on Azure Marketplace
• Use Dockerfile on Docker Hub (coming)
Develo
pm
en
t
Develo
pm
en
t/D
ep
loym
ent
Installing & running .NET on OS X using Homebrew
brew tap aspnet/dnxbrew updatebrew install dnvmdnx . kestrel
// Homebrew is a popular package manager for Mac// See https://github.com/aspnet/Home for details
• After installing Homebrew (http://brew.sh):
Installing & running .NET on Linux
tar zxvf PartsUnlimited-demo-app-linux.tar.gz -C ~/source ~/.dnx/dnvm/dnvm.shdnvm use 1.0.0-beta5-11624 -r coreclr -arch x64dnx . 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)
Chapter 3: Creating and Building an App
Development Environment Options
• Visual Studio 2015 RC
• Visual Studio Code
• Visual Studio Code
• Choose your favorite editor, e.g. Sublime Text, Atom, etc.
• Visual Studio Code
• Choose your favorite editor, Vi, Emacs, Atom, etc.
Creating an ASP.NET 5 App in Visual Studio and Deploying it to a Docker Container
Demo
Running an ASP.NET 5 App on LinuxRun: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
• .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 premiseIn cloud
Accessing Data in an Azure SQL DatabaseDemo
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
Chapter 4: Deploying an App to Linux
• 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
• Everything you need to evaluate .NET on Linux• .NET Core• ASP.NET 5• Parts Unlimited sample app
Linux VM on Azure Marketplace
• 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)
Chapter 5: Advanced Topics
Building .NET Core from Source (Windows Only)
1. Get CMake from http://www.cmake.org/download/2. 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
1. Git clone https://github.com/dotnet/corefx.git2. Build via build.cmd (from the root of the directory)3. 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
The .NET Core Repo on GitHub
• 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
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
Chapter 6: Wrap up
• .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?
• .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)
• 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
• 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?
• 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
• 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
© 2015 Microsoft Corporation. All rights reserved.
Backup
.NET Core on Windows vs Linux/OS XFeature Windows Linux / OS X
Web Server IIS or kestrel kestrel
IDE/Editor Visual Studio
Visual Studio (remote development)EmacsViSublime
Text Text Text
Text Text Text
Text Text Text
Text Text Text
Text Text Text
Text Text Text
Insert Session Code Here
Title of presentation
Name goes herePosition title goes hereSession title goes here
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 hereAdditional Microsoft brand images here (click ‘browse photography’ at top right)
ColorContent layoutsDemo and divider slidesCharts and codeScreenshots
Agenda slide
Content slides
• 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.
• 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
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.
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
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
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
Demo title (use for demo intros)
Single device preferred angle. This is another option for displaying a hardware image that sits at an angle.
Charts and code (this is a divider slide)
Charts
For content: Type is what articulates the message. Text doesn’t need to be bulleted. Text size can reinforce and impact.
52%
22%
9%
17%
Q1 Q2
Q3 Q4
Charts
For content: Type is what articulates the message. Text doesn’t need to be bulleted. Text size can reinforce and impact.
Category 1 Category 2 Category 3 Category 40
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
Series 1
Series 2
Series 3
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
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/VideoSource
VideoDecoder
VideoEffect 1
VideoEncoder
VideoEffect N
Audio/VideoSink
AudioDecoder
AudioEffect 1
AudioEncoder
AudioEffect N
<audio src=“…”><video src=“…”>
Windows Runtime (WinRT)
Diagram without text
Media Foundation
Playback/Preview(Media Engine)
New Windows 8 app
Capture(Capture Engine)
Streaming(Sharing Engine)
Transcode
Audio/VideoSource
VideoDecoder
VideoEffect 1
VideoEncoder
VideoEffect N
Audio/VideoSink
AudioDecoder
AudioEffect 1
AudioEncoder
AudioEffect N
<audio src=“…”><video src=“…”>
Windows Runtime (WinRT)
• Code content here in 24pt Consolas font. Always use this white slide for code.
Slide title here
Screenshots
• Use this slide to list resources, white papers, videos and links.
• Let attendees know their next step after seeing this session.
Call to Action
• 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)
Please Complete An Evaluation FormYour input is important!
SAMPL
E
or
Required Slide*delete this box when your slide is finalized
Evaluate this session
SAMPL
E
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.