What's new in .NET Core 3.1

This article describes what is new in .NET Core 3.1. This release contains minor improvements to .NET Core 3.0, focusing on small, but important, fixes. The most important feature about .NET Core 3.1 is that it's a long-term support (LTS) release.

If you're using Visual Studio 2019, you must update to Visual Studio 2019 version 16.4 to work with .NET Core 3.1 projects. For more information on what's new in Visual Studio, see What's New in Visual Studio 2019 version 16.4.

Visual Studio for Mac also supports and includes .NET Core 3.1 in Visual Studio for Mac 8.4.

For more information about the release, see the .NET Core 3.1 announcement.

Long-term support

.NET Core 3.1 is an LTS release with support from Microsoft for the next three years. It's highly recommended that you move your apps to .NET Core 3.1. The current lifecycle of other major releases is as follows:

Release Note
.NET Core 3.0 End of life on March 3, 2020.
.NET Core 2.2 End of life on December 23, 2019.
.NET Core 2.1 End of life on August 21, 2021.

For more information, see the .NET Core support policy.

macOS appHost and notarization

macOS only

Starting with the notarized .NET Core SDK 3.1 for macOS, the appHost setting is disabled by default. For more information, see macOS Catalina Notarization and the impact on .NET Core downloads and projects.

When the appHost setting is enabled, .NET Core generates a native Mach-O executable when you build or publish. Your app runs in the context of the appHost when it is run from source code with the dotnet run command, or by starting the Mach-O executable directly.

Without the appHost, the only way a user can start a runtime-dependent app is with the dotnet <filename.dll> command. An appHost is always created when you publish your app self-contained.

You can either configure the appHost at the project level, or toggle the appHost for a specific dotnet command with the -p:UseAppHost parameter:

  • Project file

    <PropertyGroup>
      <UseAppHost>true</UseAppHost>
    </PropertyGroup>
    
  • Command-line parameter

    dotnet run -p:UseAppHost=true
    

For more information about the UseAppHost setting, see MSBuild properties for Microsoft.NET.Sdk.

Windows Forms

Windows only

Warning

There are breaking changes in Windows Forms.

Legacy controls were included in Windows Forms that have been unavailable in the Visual Studio Designer Toolbox for some time. These were replaced with new controls back in .NET Framework 2.0. These have been removed from the Desktop SDK for .NET Core 3.1.

Removed control Recommended replacement Associated APIs removed
DataGrid DataGridView DataGridCell
DataGridRow
DataGridTableCollection
DataGridColumnCollection
DataGridTableStyle
DataGridColumnStyle
DataGridLineStyle
DataGridParentRowsLabel
DataGridParentRowsLabelStyle
DataGridBoolColumn
DataGridTextBox
GridColumnStylesCollection
GridTableStylesCollection
HitTestType
ToolBar ToolStrip ToolBarAppearance
ToolBarButton ToolStripButton ToolBarButtonClickEventArgs
ToolBarButtonClickEventHandler
ToolBarButtonStyle
ToolBarTextAlign
ContextMenu ContextMenuStrip
Menu ToolStripDropDown
ToolStripDropDownMenu
MenuItemCollection
MainMenu MenuStrip
MenuItem ToolStripMenuItem

We recommend you update your applications to .NET Core 3.1 and move to the replacement controls. Replacing the controls is a straightforward process, essentially "find and replace" on the type.

C++/CLI

Windows only

Support has been added for creating C++/CLI (also known as "managed C++") projects. Binaries produced from these projects are compatible with .NET Core 3.0 and later versions.

To add support for C++/CLI in Visual Studio 2019 version 16.4, install the Desktop development with C++ workload. This workload adds two templates to Visual Studio:

  • CLR Class Library (.NET Core)
  • CLR Empty Project (.NET Core)

Next steps