Something has Frozen Over:.NET on Linux and OS X Chris Risner Senior Technical
About Me
Agenda Why.NET on Linux / OS X The Easy Way Getting Setup Creating an App Running ASP.NET Misc / Advanced Wrap-up
Projects: 1583 Contributors 9045 Stars: Forks: 23518
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 Base class libraries NuGet packages Libraries.NET on Linux and OS X
Why on Linux? Developers – New workloads and technologies Organizations – New market opportunities IT - Platform diversification IT - Server consolidation in the cloud
Dev Benefits Customers can run.NET apps and services in Linux Support in VS for developing xPlat.NET Apps Support in VS for deploying.NET apps to Docker Edit, compile, and debug.NET code on OS X and Linux.NET Core is open source on GitHub
Docker Tools for Visual Studio 2015 Currently in preview Separate install ASP.NET 5 templates already part of VS 2015 Integrates well with Azure Pushes to any Docker host
Getting the bits!.NET Core already installed as part of VS2015 Clone repo on GitHub and build from source Install from CMD/PS Curl DNVM Install a DNX Optionally install Mono Curl DNVM Install prereqs Install a DNX Optionally install Mono Docker Development Development/Deployment
Installing on OS X
Installing on Linux
Kestrel Cross platform Web Server Built using Libuv (same as Node) Libuv is an async IO library Open Source You can run / write your own web server IIS / WebListener also work
Dev Environment Options Visual Studio 2015 Visual Studio Code Choose your favorite editor, e.g. Sublime Text, Atom, etc. Visual Studio Code Choose your favorite editor, Vi, Emacs, Atom, etc.
What’d we just see? Dnvm -.NET Version Manager Dnu -.NET Development Utility Dnx -.NET Execution Yo – yeoman Building for Mono and CoreCLR
Debugging Doesn’t work out of the box Can work with Mono Requires creating build task using xbuild and creating EXE Possible for ASP.NET but more complex Built-in to VS Code coming Working with CoreCLR coming
Unit Testing Unit test project in Yeoman Add new command Add dependencies Add test class(es) Dnx test
Deployment Xcopy deployment to target environment On-premises, IaaS, Docker, etc Deploy.NET Core with app No system wide installation necessary Package in Docker in VS
.NET Core On GitHub
Calling Native Code [DllImport("libc")] private static extern int printf(string format); … printf("Hello, //Codemash 2016!\n"); // Same as PInvoke on Windows
Setting the Environment Windows: set ASPNET_ENV=Development OS X / Linux: export ASPNET_ENV=Development (also Staging, Production)
Performance
Today Install Visual Studio 2015 on Windows Manual installs on OS X / Linux Pre-built VM on Azure Marketplace Docker using dockerfile
What’s coming? Remote debugging in VS2015 Local debugging in VS Code Performance improvements More libraries ported to.NET Core.NET Native dotnet CLI
Prepping your Apps Creating a new app Start with VS 2015 ASP.NET 5 templates Check out PartsUnlimited sample on GitHub Moving existing apps Transition to ASP.NET 5 on Windows
Go Live! Production approved Engage directly with teams on GitHub
DayRoomEventSpeaker Thu 8:00AMSalon E The Hitchhiker's Guide to Azure Mobile Apps David Giard Fri 4:00PMAloeswood/Leopardwood Secrets of Success in the style of GLEE Jennifer Marsman Thu 9:15AMMangrove Something has Frozen Over:.NET on Linux and OS X Chris Risner Thu 9:15AMSalon A Designing a Game for Mobile Amanda Lange Thu 11:45PMSalon A Rise of the Machines Josh Holmes Fri 4:00PMOrange Cloud-Scale Event Processing with the Reactive Extensions (Rx) Matthew Podwysocki Thu 10:30AMZambezi Designing C# 7 in the Open Kevin Pilch-Bisson Fri 9:45AMAloeswood/Leopardwood Big Data for the SQL Ninja Matt Winkler Thu 3:30PMZambezi Cloud Design Patterns for Scalability and Performance Matt Johnson Thu 1:00PMGuava/Tamarind Getting Started with nuML, an Open Source.NET Machine Learning Library Seth Juarez Thu 9:15AMSalon H Tracking Real World Web Performance Nik Molnar Thu 9:15AMSagewood/Zebrawood The Code Behind the Vulnerability Barry Dorrans Thu 1:00PMSagewood/Zebrawood Introducing the new ASP.NET Authorization and Data Protection Stacks Barry Dorrans
DayRoomEventSpeaker Tue 1:00PMSalon A Cross Platform Mobile UI with Xamarin Forms WorkshopJason Awbrey Wed 8:00AMAloeswood, Leopardwood Tune SQL Server Like a Guru! – Part 1Kevin Boles Wed 11:45:AM Cypress Async Everywhere!Stephen Cleary Wed 11:45:AM Aloeswood, Leopardwood Abstract Art: Getting Abstraction “Just Right”Jeremy Clark Wed 1:00PMAloeswood, Leopardwood Tune SQL Server Like a Guru! – Part 2Kevin Boles Thu 8:00AMNile CQRS 2.0David Hoerster Thu 8:00AMZambezi Node.js Crash CourseDavid Neal Thu 10:30AMSagewood, Zebrawood Whose Shoulders are These?Jack Daniel Thu 10:30AMOrange Bringing Up Our Future – On Mentoring Junior DevelopersSarah Dutkiewicz Thu 10:30AMIndigo Bay Consuming REST APIs, for all interpretations of RESTDarrel Miller Thu 10:30AMSalon A A Look at Team Foundation Server 2015 BuildPaul Hacker Thu 11:45AMIndigo Bay Common TSQL MistakesKevin Boles Thu 1:00PMAloeswood, Leopardwood Growing a Testing^H^H^H^H^H^H^HWhole Quality Team The Hard WayJim Holmes Thu 1:00PMSalon D Getting Started with 3D PrintingAdam Barney Thu 1:00PMSalon A Hypermedia APIs: The rest of RESTChris Marinos Thu 3:30PMSuite 1, Suite 6 Why I Left Angular and Knockout for ReactCory House Thu 3:30PMAloeswood, Leopardwood Load Testing Your Web Application in Visual Studio: A Case StudyJames Bender Fri 9:45AMSalon D Electronics 101 for IoT DevelopersAdam Barney Fri 9:45AMSalon E Convention Over Configuration: Queueing is EasyMatthew Groves Fri 9:45AMSuite 1, Suite 6 “OMG! This Codebase Sucks!” Paying Down Technical Debt While Continuing to Deliver ValueJim Holmes Fri 9:45AMMangrove XAML & C# Powered iOS, Android, and Windows appsJames Montemagno Fri 12:15PMZambezi ECMAScript 2015 & JavaScript – Don’t Get Left BehindJared Faris Fri 4:00PMIndigo Bay Cross-Platform Desktop Apps with ElectronDavid Neal
Docker file FROM microsoft/aspnet:1.0.0-rc1 COPY. /app WORKDIR /app RUN ["dnu", "restore"] EXPOSE 5000/tcp ENTRYPOINT ["dnx", "-p" "project.json", "web"]