Modernizing your. NET applications with. NET Standard, Modernizing your .NET applications with .NET Standard, .NET Core, Docker, and Azure Eilon Lipton elipton@microsoft.com Principal Group Software Engineering Manager Microsoft (Redmond, WA)
One library to rule them all 12/29/2017 2:33 PM .NET Standard library One library to rule them all Learn one API across ALL .NET platforms Reuse your code across ALL .NET platforms Easily consume third-party/OSS libraries across ALL .NET platforms .NET Standard 1.x Evolution of Portable Class Libraries (PCLs) with a much simpler model Two constraints: API surface relatively small, because .NET Core was small Can’t reference the vast number of libraries already available for .NET Framework © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
.NET Standard WINDOWS DESKTOP WINDOWS UWP CLOUD MICROSERVICES IOS, ANDROID .NET STANDARD INFRASTRUCTURE COMPILERS LANGUAGES RUNTIME COMPONENTS GAMES/ 3D Visual Studio Visual Studio Code Visual Studio for Mac .NET Standard allows sharing code, binaries, and skills between .NET client, server, and all flavors .NET Standard provides a specification for any platform to implement All .NET runtimes provided by Microsoft implement the standard
PORTABLE CLASS LIBRARY 12/29/2017 2:33 PM Nothing changes MY .NET FRAMEWORK APP MY .NET CORE APP MY XAMARIN APP MY STANDARD LIBRARY EXISTING .NET STANDARD LIBRARY EXISTING PORTABLE CLASS LIBRARY EXISTING .NET FRAMEWORK LIBRARY © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Announcing .NET Standard 2.0 (Preview) 12/29/2017 2:33 PM Announcing .NET Standard 2.0 (Preview) +20K More APIs than .NET Standard 1.x Has much bigger API surface Extended to cover intersection between .NET Framework and Xamarin Also makes .NET Core 2.0 bigger as it implements .NET Standard 2.0 ~70% of NuGet packages are API compatible Can reference .NET Framework libraries Compatibility shim allows referencing existing .NET Framework binaries No recompile required – also covers existing NuGet packages Limited to libraries that only use APIs that are available for .NET Standard © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
APIs in .NET Standard 2.0 XML SERIALIZATION NETWORKING IO THREADING XLinq • XML Document • XPath • Schema • XSL SERIALIZATION BinaryFormatter • Data Contract • XML NETWORKING Sockets • HTTP • Mail • WebSockets IO Files • Compression • MMF THREADING Threads • Thread Pool • Tasks CORE Primitives • Collections • Reflection • Interop • Linq
Reference Framework as single package Simplified packaging .NET Core 2.0 .NET Standard 2.0 Reference Framework as single package Simplified packaging ASP.NET Core and Entity Framework Core included ASP.NET Core 2 Automatic diagnostics Razor Pages Entity Framework Core 2
DEMO: .NET Standard across the world
Visual Studio 2017 – RTM March 7 Improved performance, new install experience Faster navigation Code style configuration and enforcement Live Unit Testing IntelliSense improvements New exception helper More refactorings and quick fixes C# 7.0
Coming in Visual Studio 2017 Update 3 Additional polish to navigation and IntelliSense .NET Core support for Live Unit Testing Code style enforcement on builds More live diagnostics on API design, security, etc. Even more refactorings and quick fixes C# 7.1
DEMO: Live unit testing
.NET Core and Visual Studio for Mac Provide the SAME experience across Windows and Mac Sharing components with Visual Studio .NET Core Project Templates HTML, CSS, JSON editors Backend debugger Azure Publish infrastructure Future JavaScript, Razor editors
.NET Core and Visual Studio for Mac Full .NET Core Tooling including round tripping between Windows and Mac Docker Containers with debugging Publish to App Service Publish to App Service Containers Azure Functions
DEMO: Visual Studio for Mac
Azure diagnostics Should be simple From the Portal From Visual Studio No modifications to your app No republishing of your app From the Portal Enable/Disable analytics and diagnostics See common crashes and performance problems including seeing code From Visual Studio See analytics data from portal in real time Use “snap points” to debug a running application
DEMO: Azure Application Insights
Docker For build-time or for runtime On Windows or on Linux Choose your base image And upgrade it as necessary Features coming to .NET for coordinating multiple images For example, health checks, service discovery Works in Visual Studio, Visual Studio for Mac, and VS Code Debug remotely using VS Azure supports Windows and Linux containers Azure Container Service for Linux (Windows coming) Service Fabric for Windows (Linux coming)
DEMO: Docker with Visual Studio
Summary .NET Standard for productivity .NET Core for fast-paced, cross-platform, standalone/SxS dev/deploy Visual Studio 2017 Live Unit Testing and C# Visual Studio for Mac for collaboration Azure for simplified app management and diagnostics Docker for reliable deployment, easy configuration, and scale
Related sessions I will present today… 14:20 Deep dive into .NET Core 2.0 and ASP.NET Core 2.0 / Aulets Other presentations tomorrow… 11:40 Building a Xamarin Forms app using data from DNN / Peter Schotman / Aulets 17:00 Goodbye VMs - Hello Docker / Joe Brinkman / Aulets
Learn more .NET Conf 2017 (September 19 – 21) http://www.dotnetconf.net/ .NET home page https://dot.net/ .NET Architecture https://www.microsoft.com/net/learn/architecture Channel 9 videos from //BUILD and other conferences https://channel9.msdn.com/Events/Build/2017 (400+ videos)
12/29/2017 © 2017 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.