The following improvements are new in Preview 4 and not otherwise covered in the earlier highlights section.
Building on the F# 5 preview released earlier this year, the update to F# 5 includes support for consuming Default Interface Methods (DIMs) and some big performance improvements. Here’s a sneak peek at the DIMs support in F#:
open CSharp
// You can implement the interface via a class
type MyType() =
member _.M() = ()
interface MyDim
let md = MyType() :> MyDim
printfn "DIM from C#: %d" md.Z
// You can also implement it via an object expression
let md' = { new MyDim }
printfn "DIM from C# but via Object Expression: %d" md'.Z
For more information, you can read the F# 5 update for .NET 5 preview 4.
An update to the C# Source Generators preview is included in this iteration.
analyzerconfig
, wich is essentially a list of key-value pairs, to a Source Generator.analyzerconfig
allows you to pass information like a consuming project's TFM to allow for exactly this scenario..NET now has support for cgroup v2, which we expect will become an important container-related API in 2020 and beyond.
Everyone is always looking for opportunities to make .NET container images smaller and easier to use.
This change has the following win for multi-stage builds.
Multi-stage build costs with Ubuntu 20.04 Focal:
Pull Image | Before | After |
---|---|---|
sdk:5.0-focal | 268 MB | 232 MB |
aspnet:5.0-focal | 64 MB | 10 KB (manifest only) |
Net download savings: 100 MB (-30%)
Multi-stage build costs with Debian 10 Buster:
Pull Image | Before | After |
---|---|---|
sdk:5.0 | 280 MB | 218 MB |
aspnet:5.0 | 84 MB | 4 KB (manifest only) |
Net download savings: 146 MB (-40%)
As part of the move to .NET as the product name, first, they publish .NET 5.0 Preview 4 and later images to the mcr.microsoft.com/dotnet
family of repos, instead of mcr.microsoft.com/dotnet/core
.
mcr.microsoft.com/dotnet/core
.