A First Look at .NET Core 2.0
An early look at the major improvements coming in .NET Core 2.0. We explore the massive expansion of the API surface area with .NET Standard 2.0 and other features that promise to make .NET Core easier to use than ever.
.NET Core 1.0 was a revolutionary first step, establishing a new, cross-platform foundation for .NET. However, many developers found it challenging to port their existing code because a large number of familiar APIs from the full .NET Framework were missing. With the upcoming release of .NET Core 2.0, Microsoft is addressing this head-on, making it dramatically easier to build and port applications.
The preview releases of .NET Core 2.0 have shown that this will be a landmark release focused on usability, performance, and API convergence.
The Biggest News: .NET Standard 2.0
The headline feature of the .NET Core 2.0 wave is .NET Standard 2.0. The .NET Standard is a formal specification of APIs that all .NET platforms must implement. .NET Standard 2.0 is a massive expansion of this specification, more than doubling the number of available APIs from around 13,000 to over 32,000.
What does this mean in practice? It means that a huge number of the APIs that developers know and love from the .NET Framework are now part of the standard. This makes it incredibly easy to:
- Port existing code: A huge amount of existing .NET Framework code can now be recompiled to target .NET Standard 2.0 with little to no modification.
- Share code: You can create a single .NET Standard 2.0 library that can be used across the .NET Framework, .NET Core, and Xamarin.
To make porting even easier, .NET Core 2.0 will also include a compatibility shim that allows .NET Standard libraries to reference existing .NET Framework NuGet packages, further bridging the gap between the two platforms.
Simplified Package Management
In .NET Core 1.x, a new project would reference dozens of small NuGet packages for the base class library. This could be tedious to manage. .NET Core 2.0 introduces a new metapackage, Microsoft.AspNetCore.All
, which includes all the dependencies for ASP.NET Core and Entity Framework Core. By referencing this single package, you get everything you need, and the build process will automatically trim out any assemblies that your application doesn't use.
ASP.NET Core 2.0
ASP.NET Core 2.0, which will be released with .NET Core 2.0, also brings a host of improvements.
- Razor Pages: A new, simplified, page-centric model for building web UIs. It's designed to be an easier entry point for developers who find the full MVC (Model-View-Controller) pattern to be too complex for simple pages.
- Simplified
Program.cs
: The configuration of the web host inProgram.cs
has been simplified, hiding some of the boilerplate and making it easier to get started.
Performance Improvements
While .NET Core 1.x was already fast, .NET Core 2.0 continues to push the boundaries of performance. The runtime and JIT compiler have been further optimized, making .NET Core one of the fastest web development platforms available.
A More Mature Platform
.NET Core 2.0 represents a huge step forward in the maturity and usability of the platform. By dramatically expanding the available API surface and simplifying dependency management, Microsoft is making it easier than ever for developers to adopt .NET Core for their new and existing applications.
With its combination of cross-platform reach, open-source development, and now a much larger and more familiar set of APIs, .NET Core 2.0 is poised to see a massive wave of adoption and solidify its place as the future of .NET.