asp.net on mac, linux and the open-source culture
Post on 24-Jan-2018
2.057 Views
Preview:
TRANSCRIPT
ASP.NET on Mac, Linux andthe Open-‐Source cultureRicardo Fiel
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://ricardofiel.comricardo.fiel@rupeal.com
Agenda1. Evolution and why open-‐source matters2. Getting up and running3. Going live
How did ASP.NET the web evolve?
This used to be simple!
Challenge – Frontend
Challenge – The Server
Diversification
Our story – InvoiceXpress Architecture + Dev Culture
Collaboration (Microservices + Devops)
Containers!!
So, what’s ASP.NET open-‐source?
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
.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
Building ASP.NET on a Mac
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
Editors and IDEs – OmniSharp community effort
Let’s focus on Yeoman + VS Code
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
Demo time!Generating an app with yeoman and running it
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
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
Demo time!Deploying to Azure Web Apps and Linux VMs
Last words and testament
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
• .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
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
Going Deep
https://github.com/aspnet/Home/wiki/DNX-‐structure
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 ...
Calling all devs! -‐ December 10, Lisbon
mergelisbon.com
@theplastictoyhttp://ricardofiel.comricardo.fiel@rupeal.com
Thank You!
top related