.NET Core 2.0 is available today as a final release. You can start developing with it at the command line, in your favorite text editor, in Visual Studio 2017 15.3, Visual Studio Code or Visual Studio for Mac. It is ready for production workloads, on your own hardware or your favorite cloud, like Microsoft Azure.
We are also releasing ASP.NET Core 2.0 and Entity Framework Core 2.0. Read the ASP.NET Core 2.0 and the Entity Framework Core 2.0 announcements for details. You can also watch the launch video on Channel 9 to see many of the new features in action.
The .NET Standard 2.0 spec is complete, finalized at the same time as .NET Core 2.0. .NET Standard is a key effort to improve code sharing and to make the APIs available in each .NET implementation more consistent. .NET Standard 2.0 more than doubles that set of APIs that you have available for your projects.
.NET Core 2.0 has been deployed to Azure Web Apps. It is available today in a small number of regions and will expand globally quickly.
.NET Core 2.0 includes major improvements that make .NET Core easier to use and much more capable as a platform. The following improvements are the biggest ones and others are described in the body of this post. Please share feedback and any issues you encounter at dotnet/core #812.
- Live Unit Testing supports .NET Core
- Code navigation improvements
- C# Azure Functions support in the box
- CI/CD support for containers
For Visual Studio users: You need to update to the latest versions of Visual Studio to use .NET Core 2.0. You will need to install the .NET Core 2.0 SDK separately for this update.
On behalf of the entire team, I want to express our gratitude for all the direct contributions that we received for .NET Core 2.0. Thanks! Some of the most prolific contributors for .NET Core 2.0 are from companies investing in .NET Core, other than Microsoft. Thanks to Samsung and Qualcomm for your contributions to .NET Core.
The .NET Core team shipped two .NET Core 2.0 previews (preview 1 and preview 2) leading up to today’s release. Thanks to everyone who tried out those releases and gave us feedback.
Using .NET Core 2.0
You can get started with .NET Core 2.0 in just a few minutes, on Windows macOS or Linux.
You first need to install the .NET Core SDK 2.0.
You can create .NET Core 2.0 apps on the command line or in Visual Studio.
Creating new projects is easy. There are templates you can use in Visual Studio 2017. You can also create new application at the command line with
dotnet new, as you can see in the following example.
C:samples>dotnet new console -o console-app
You can also upgrade an existing application to .NET Core 2.0. In Visual Studio, you can change the target framework of an application to .NET Core 2.0.
If you are working with Visual Studio Code or another text editor, you will need to update the target framework to
It is not as critical to update libraries to .NET Standard 2.0. In general, libraries should target the lowest version of .NET Standard they can tolerate (for maximum .NET implementation applicability) unless they require APIs only in .NET Core. If you do want to update libraries, you can do it the same way, either in Visual Studio or directly in the project file, as you can see with the following project file segment that target .NET Standard 2.0.
You can read more in-depth instructions in the Migrating from ASP.NET Core 1.x to ASP.NET Core 2.0 document.
Relationship to .NET Core 1.0 and 1.1 Apps
You can install .NET Core 2.0 on machines with .NET Core 1.0 and 1.1. Your 1.0 and 1.1 applications will continue to use the 1.0 and 1.1 runtimes, respectively. They will not roll forward to the 2.0 runtime unless you explicitly update your apps to do so.
By default, the latest SDK is always used. After installing the .NET Core 2.0 SDK, you will use it for all projects, including 1.0 and 1.1 projects. As stated above, 1.0 and 1.1 projects will still use the 1.0 and 1.1 runtimes, respectively.
You can configure a directory (all the way up to a whole drive) to use a specific SDK by creating a global.json file that specifies a specific .NET Core SDK version. All
dotnet uses “under” that file will use that version of the SDK. If you do that, make sure you have that version installed.
.NET Core Runtime Improvements
The .NET Core 2.0 Runtime has the following improvements.
There are many performance improvements in .NET Core 2.0. The team published a few posts describing the improvements to the .NET Core Runtime in detail.
.NET Core 2.0 Implements .NET Standard 2.0
The .NET Standard 2.0 spec has been finalized at the same time as .NET Core 2.0.
We have more than doubled the set of available APIs in .NET Standard from 13k in .NET Standard 1.6 to 32k in .NET Standard 2.0. Most of the added APIs are .NET Framework APIs. These additions make it much easier to port existing code to .NET Standard, and, by extension, to any .NET implementation of .NET Standard, such as .NET Core 2.0 and the upcoming version of Universal Windows Platform (UWP).
.NET Core 2.0 implements the .NET Standard 2.0 spec: all 32k APIs that the spec defines.
You can see a diff between .NET Core 2.0 and .NET Standard 2.0 to understand the set of APIs that .NET Core 2.0 provides beyond the set required by the .NET Standard 2.0 spec.
Much easier to target Linux as a single operating system
.NET Core 2.0 treats Linux as a single operating system. There is now a single Linux build (per chip architecture) that works on all Linux distros that we’ve tested. Our support so far is specific to glibc-based distros and more specifically Debian- and Red Hat-based Linux distros.
There are other Linux distros that we would like to support, like those that use musl C Standard library, such as Alpine. Alpine will be supported in a later release.
Please tell us if the .NET Core 2.0 Linux build doesn’t work well on your favorite Linux distro.
Similar improvements have been made for Windows and macOS. You can now publish for the following “runtimes”.
Linux and Windows ARM32 builds now available, in Preview
Globalization Invariant Mode
.NET Core 2.0 includes a new .NET Core SDK Improvements
The .NET Core SDK 2.0 has the following improvements.
dotnet restore is implicit for commands that require it
dotnet restore command has been a required set of keystrokes with .NET Core to date. The command installs required project dependencies and some other tasks. It’s easy to forget to type it and the error messages that tell you that you need to type it are not always helpful. It is now implicitly called on your behalf for commands like
The following example workflow demonstates the absense of a required
dotnet restore command:
C:Usersrich>dotnet new mvc -o mvcapp
The template "ASP.NET Core Web App (Model-View-Controller)" was created successfully.
This template contains technologies from parties other than Microsoft, see https://aka.ms/template-3pn for details.
Processing post-creation actions...
Running 'dotnet restore' on mvcappmvcapp.csproj...
Restoring packages for C:Usersrichmvcappmvcapp.csproj...
Restore completed in 32.3 ms for C:Usersrichmvcappmvcapp.csproj.
Generating MSBuild file C:Usersrichmvcappobjmvcapp.csproj.nuget.g.props.
Generating MSBuild file C:Usersrichmvcappobjmvcapp.csproj.nuget.g.targets.
Restore completed in 2.26 sec for C:Usersrichmvcappmvcapp.csproj.
Hosting environment: Production
Content root path: C:Usersrichmvcapp
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
Application is shutting down...
Reference .NET Framework libraries from .NET Standard
You can now reference .NET Framework libraries from .NET Standard libraries using Visual Studio 2017 15.3. This feature helps you migrate .NET Framework code to .NET Standard or .NET Core over time (start with binaries and then move to source). It is also useful in the case that the source code is no longer accessible or is lost for a .NET Framework library, enabling it to be still be used in new scenarios.
We expect that this feature will be used most commonly from .NET Standard libraries. It also works for .NET Core apps and libraries. They can depend on .NET Framework libraries, too.
The supported scenario is referencing a .NET Framework library that happens to only use types within the .NET Standard API set. Also, it is only supported for libraries that target .NET Framework 4.6.1 or earlier (even .NET Framework 1.0 is fine). If the .NET Framework library you reference relies on WPF, the library will not work (or at least not in all cases). You can use libraries that depend on additional APIs,but not for the codepaths you use. In that case, you will need to invest singificantly in testing.
You can see this feature in use in the following images.
The call stack for this app makes the dependency from .NET Core to .NET Standard to .NET Framework more obvious.
.NET Standard NuGet Packages no longer have required dependencies
.NET Standard NuGet packages no longer have any required dependencies if they target .NET Standard 2.0 or later. The .NET Standard dependency is now provided by the .NET Core SDK. It isn’t necessary as a NuGet artifact.
The following is an example nuspec (recipe for a NuGet package) targeting .NET Standard 2.0.
xml version="1.0" encoding="utf-8"?>
<group targetFramework=".NETStandard2.0" />
The following is an example nuspec (recipe for a NuGet package) targeting .NET Standard 1.4.
xml version="1.0" encoding="utf-8"?>
<dependency id="NETStandard.Library" version="1.6.1" exclude="Build,Analyzers" />
Visual Studio 2017 version 15.3 updates
Visual Studio now has the ability to recognize the install of an updated .NET Core SDK and light up corresponding tooling within Visual Studio. With 15.3, Visual Studio now provides side-by-side support for .NET Core SDKs and defaults to utilizing the highest version installed in the machine when creating new projects while giving you the flexibility to specify and use older versions if needed, via the use of global.json file. Thus, a single version of Visual Studio can now build projects that target different versions of .NET Core.
Support for Visual Basic
In addition to supporting C# and F#, 15.3 now also supports using Visual Basic to develop .NET Core apps. Our aim with Visual Basic this release was to enable .NET Standard 2.0 class libraries. This means Visual Basic only offers templates for class libraries and console apps at this time, while C# and F# also include templates for ASP.NET Core 2.0 apps. Keep an eye on this blog for updates.
Live Unit Testing Support
IDE Productivity enhancements
Visual Studio 2017 15.3 has several productivity enhancements to help you write better code faster. We now support
We’ve added a handful of new refactorings including:
- Resolve merge conflict
- Add parameter (from callsite)
- Generate overrides
- Add named argument
- Add null-check for parameters
- Insert digit-separators into literals
- Change base for numeric literals (e.g., hex to binary)
- Convert if-to-switch
- Remove unused variable
Project System simplifications
We further simplified the .csproj project file by removing some unnecessary elements that were confusing to users and wherever possible we now derive them implicitly. Simplification trickles down to Solution Explorer view as well. Nodes in Solution Explorer are now neatly organized into categories within the Dependencies node, like NuGet, project-to-project references, SDK, etc.
Another enhancement made to the .NET Core project system is that it is now more efficient when it comes to builds. If nothing changed and the project appears to be up to date since the last build, then it won’t waste build cycles.
Several important Support and Lifecycle
.NET Core 2.0 is a new release, .NET Core 1.1
.NET Core 1.1 has transitioned to LTS Support, adopting the same LTS timeframe as .NET Core 1.0.
.NET Core 1.0 and 1.1 will both go out of support on June 27, 2019 or 12 months after the .NET Core 2.0 LTS release, whichever is shorter.
We recommend that all 1.0 customers move to 1.1, if not to 2.0. .NET Core 1.1 has important usability fixes in it that make for a significantly better development experience than 1.0.
Red Hat also provides full support for .NET Core on RHEL and will be providing a distribution of .NET Core 2.0 very soon. We’re excited to see our partners like Red Hat follow our release so quickly. For more information head to Closing
We’re very excited on this significant milestone for .NET Core. Not only is the 2.0 release our fastest version of .NET ever, the .NET Standard 2.0 delivers on the promise of .NET everywhere. In conjunction with the Visual Studio family, .NET Core provides the most productive development platform for developers using MacOS or Linux as well as Windows. We encourage you to download the latest .NET Core SDK from https://dot.net/core and start working with this new version of .NET Core.
Please share feedback and any issues you encounter at dotnet/core #812.
Watch the launch video for .NET Core 2.0 to see this new release in action.