.Net Core 2.0: Everything you need to know

In the cloud and on all your devices, the latest .Net release will give you a common framework for all your enterprise code

.Net Core 2.0: Everything you need to know
Gerd Altmann (CC0)

Microsoft’s .Net development platform has been around a long time now as the heart of the company’s development tool and platform strategy. Having begun life as a Windows-only tool that brought new languages and methodologies to the platform, it’s grown to become a cross-platform environment that supports everything from wearables to walls and on into the cloud.

.Net has long had cross-platform ambitions, starting with the release of the educational Rotor runtime and tools back in 2002 under a noncommercial shared-source license, and continuing with its sadly undelivered plans for the cross-platform WP/E, the .Net runtime that became Silverlight.

Xamarin’s Mono offered an open source .Net for Linux built to ECMA standard APIs, eventually finding success as a mobile runtime for both iOS and Android. However, concerns about the limitations of Microsoft’s patent promise kept many Linux developers from using Mono. Microsoft eventually purchased Xamarin in 2016, and relicensed Mono under a permissive MIT license, with an expanded patent promise.

Open source .Net at the Core

With more than 17 years of development under its belt, the .Net Framework is a large and complex piece of software. So it wasn’t surprising that, when Microsoft open-sourced its .Net design and development process in 2014, it did so as the newly refactored .Net Core. Instead of a monolithic .Net, .Net Core is a modular implementation of a subset of the .Net APIs, able to run on a wide selection of platforms and on more than one runtime.

Initially, .Net Core didn’t support many of the key .Net Framework APIs and libraries, with a focus on UI-less web back ends and on born-in-the-cloud applications.

Over the last couple of years, that’s changed, as .Net Core and the associated .Net Standard libraries have evolved. Now, with the release of .Net Core 2.0 and .Net Standard 2.0, you’ve got access to more than twice the APIs you had with the previous release, plus  access to many Windows and non-Windows platforms, including ARM32 on Linux and the latest MacOS releases.

To get the most out of .Net Core 2.0, you need to get very familiar with .Net Standard 2.0. Intended to be supported by all .Net implementations, .Net Standard 2.0 has more than 32,000 APIs, including many familiar .Net Framework APIs. It now replaces Portable Class Libraries. Any new libraries you build to work with .Net Standard should work anywhere; simplifying cross-platform development by ensuring that all your libraries work against a common set of APIs. There’s even support for calling through to existing .Net Framework APIs to maintain compatibility while you port code to the new frameworks.

A modular .Net for a containerized world

One important element of .Net Core is its use of the NuGet package-management tools. If you’ve been building .Net applications in Visual Studio, you’re familiar with adding libraries and other packages to your code from NuGet. Now, with .Net Core, you’ll also install the .Net modules you need along with the libraries you want.

The result is a more modular .Net, where code that’s not needed isn’t loaded. That’s an important change, and one that makes sense in the light of the changes Microsoft has also been making to its Nano Server container OS, and with its work with container-optimized Linux distributions.

With a smaller OS and a smaller, more customizable, runtime, you’ll be able to optimize your applications for use in fast-deploying containers – either on Windows containers or with a thin container Linux like CoreOS.

.Net Core’s modularity also helps with .Net development targeting resource limited devices, like Raspberry PI running the IoT releases of Windows 10 or smartwatches running Samsung’s Tizen.

Microsoft is already moving its Docker tools to .Net Core 2.0, with improved Docker Hub tagging and support for ARM64 and ARM32 images. Building and deploying to Docker with the latest Visual Studio releases means working with .Net Core 2.0 base images, using .Net Standard 6.0 libraries. The result should be more portable containers, as well as more deployment options for your code on the main cloud platforms.

Is this the enterprise application future?

.Net Core isn’t only a newer, lighter .Net—it’s the start of Microsoft’s push to be the dominant platform for complex containerized applications. Java’s enterprise uncertainty and stagnation under Oracle’s stewardship has put it out of the running for now, and while newer languages like Go have a growing following, they’re still only really beginning to gain developer mindshare. When Node.js is your only real option for microservices, it’s time for an alternate approach.

By refactoring .Net for this new world, Microsoft is delivering an appropriate platform for these new application architectures while bringing along more than a decade of developer experience.

It’s a smart move. Your existing C# skills carry on being relevant, while applications that require functional programming can move to F#. Existing code can be containerized, while new applications can extend and replace that older code to launch new services. Meanwhile, your .Net Core-based container applications are now OS-agnostic, able to use Windows or Linux .Net runtimes, with code that’s portable enough to run IoT hardware at one end of the scale and in the cloud at the other.

Microsoft’s new mantra of the intelligent cloud and the intelligent edge depends on .Net Core and its modular nature. With one programming model that works across your choice of devices and platforms, distributing functionality across compute in and out the cloud is now a possibility. All you need is a distributed architecture to host and deploy code appropriately.

That last part is still where .Net needs work. There are elements of it in place, like the Project Orleans virtual actor model and Azure’s Service Fabric. But Visual Studio lacks the tools to visualize how to deploy and scale applications. Still, with Microsoft’s ongoing investments in Azure for Kubernetes-related tools, it’s likely to be something that’ll arrive sooner rather than later. Even so, it pays to think carefully about how you’re building distributed code and how you’ll connect it to a back end.

Despite that one weak area, the modular, flexible .Net Core and the associated set of .Net Standard APIs look to be the ideal foundation for a new generation of enterprise applications. You can use them to start building new code today, and then migrate older .Net applications to the new frameworks as existing libraries move to supporting .Net Standard. Modernizing your code base will take time, but at least you can now see where to start.

Copyright © 2017 IDG Communications, Inc.