What’s new in .NET Core 3.0

In this post, we will discuss about the recent .Net Core 3.0 release. It was released on Sept 23, 2019. Also C# 8.0 was a part of the same release. We will also look at some of the major improvements done. Let’s then begin to see what’s new in .Net Core 3.

Download .Net Core 3.0

.NET Core 3.0 is part of Visual Studio 2019 16.3.

Supported Platforms

.NET Core 3.0 is supported on the following operating systems as per the official site:

  • Windows Clientversions – 7, 8.1, 10 (1607+)
  • Windows Server – 2012 R2 SP1+
  • macOS version – 10.13+
  • Ubuntu version – 16.04+
  • Debian version – 9+
  • openSUSE version – 42.3+

Other OS (Alpine: 3.9+, Fedora: 26+, RHEL: 6+, SLES: 12+)

Key improvement in .Net Core 3.0

Below is a quick list containing the key improvements in .Net Core 3:

Designed to work efficiently with Docker
In order to allow .NET applications to work efficiently in containers, .Net Core 3 has been designed to work with Docker. Accordingly, when a container has been configured to work in lower memory or CPU requirements, the GC has been updated to work much better. Subsequently, .Net Core container images are small in size.

C# 8
.Net Core 3 also has C# version 8. This version adds increased patterns, range/index, and nullable ref types. Hence which objects are capable of throwing NullReferenceException for null expecation.

Also in C# 8.0, an interface body can be provided for a method. In case a class that implements the interface doesn’t implement that method then the method call will get the default implementation instead.

interface ILogger
{
    void Log(LogLevel level, string message);
    void Log(Exception ex) => Log(LogLevel.Error, ex.ToString());
    //New overload
}

class ConsoleLogger : ILogger
{
    public void Log(LogLevel level, string message){...}
    //Log(Exception) gets default implementation
}

Here ConsoleLogger class does not have to implement the Log(Exception) method of ILogger, because it is declared with a default body. Now you can add new members to existing public interfaces provided youhave a default implementation for existing classes to use.

F# 4.7 
F# library points to .NET Standard 2 so below of the few enhancements are available

  • The WebExtensions namespace for working with older web APIs in an F#-user friendly way
  • Tool like Paket have simpler dependencies
  • The  FuncConvert.ToFSharpFunc<'T>  method
  • Access to the  MatchFailureException  type
  • Implicit conversions between FSharpFunc<T,TResult> and Converter<T, TResult>

JSON API enhancements 
Performance enhancements have been added in JSON API for I/O and serialization. The APIs target allocation minimizations for less workload for GC and faster performance.

Executables 
.Net Core applications have default executables. Earlier these apps had to be launched as below:
dotnet myapp.dll
Now apps can bestarted with an executable, like  ./myapp or myapp (based on the OS)

GC consumes lesser memory
The GC has been updated to take advantage of more number of CPU cores on larger machines having more than 64 cores for co-hosted apps.

Visual Studio 2019 16.3
For Windows developers wanting to develop on .Net Core 3, updating to Visual Studio 2019 16.3 is required.

Windows Forms and WPF
Both Windows Forms and WPF are supported on .Net Core 3. Since the WPF designer is a part of VS 2019 16.3 it is still in preview.

Performance Improvements
There are a lot of performance improvements hence you can have a look at it from below link:
https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-core-3-0/

.NET Standard 2.1 
This included more number of types that can be used in code on both Xamarin and .Net Core.

What’s next

Azure App Service 
.NET Core 3 deployment using Azure App Service is coming soon as per the official Microsoft Blog.

Azure DevOps
.NET Core 3 deployment using Azure DevOps is coming soon as per the official Microsoft Blog.

Future Versions
After .NET Core 3 release, it will be followed by .NET Core 3.1, around in November 2019. It will be a long-term supported (LTS) release (support for minimum 3 years). It is recommended to update to .NET Core 3 and then to 3.1.

Summary

Release of .Net Core 3 greatly provides improvements with reduction in SDK size, support for containers and Windows desktop applications. This is a major release of .NET Core with C# 8 being a part of this release. It is recommended that to update current projects to target .NET Core 3 as it is compatible with previous versions. Hope you enjoyed this post, do share to someone who might find this article useful. Keep visiting the blog.

Hitesh Boricha

I have a little over a decade experience in the IT industry. Having worked in various roles in this industry, I am passionate about technology.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.