Announcing .NET 5 Preview 1
At the end of last year, we shipped .NET Core 3.0 and 3.1. These versions added the desktop app models Windows Forms (WinForms) and WPF, ASP.NET Blazor for building single page applications and gRPC for cross-platform, contract-based messaging. We also added templates for building services, rich generation of client code for talking to gRPC, REST API services, and a lot more. We’re excited to see that .NET Core 3 has become the fastest adopted version of .NET ever and we’ve gained another million more users in just the last year.
We also communicated with these releases that this would conclude the porting of the app models from .NET Framework. With .NET Core 3, we have ported all of the most used app models as well as introduced newer cross- platform frameworks to replace the ones we did not port.
As we look forward to the next major release, .NET 5, we will continue to unify .NET into a single platform by including our .NET mobile device app model (Xamarin) in .NET 5. .NET 5 will include ASP.NET Core, Entity Framework Core, WinForms, WPF, Xamarin and ML.NET. For the first time, the entire platform will use a unified BCL (Base Class Libraries) for all the app models. Having a version 5 that is higher than both .NET Core and .NET Framework also makes it clear that .NET 5 is the future of .NET, which is a single unified platform for building any type of application.
We have said this many times, but we will reiterate again; .NET Core and then .NET 5 is the .NET you should build all your NEW applications with. .NET Framework will remain supported as long as Windows itself is supported. We will continue to provide security and bug fixes and keep the networking and crypto API’s up to date. It will remain safe and supported to keep your older applications on .NET Framework.
Install .NET 5.0 Preview 1
Today we are releasing the first preview of .NET 5, which is scheduled to GA (General Availability) later this year in November.
See ASP.NET Core updates in .NET 5 Preview 1 to learn about today’s ASP.NET Core release.
Preview 1 includes support for Windows ARM64 for the first time. Today’s release includes the .NET Core runtime. We expect Preview 2 to include the SDK (ASP.NET Core but not WPF or Windows Forms). A later preview will include WPF and Windows Forms. Support for Windows ARM64 will also be back-ported to .NET Core 3.1. We will share more information on that with the Preview 2 post.
Updating existing projects
You can update existing projects by updating your target framework, as follows:
<TargetFramework>netcoreapp5.0</TargetFramework>
High-level goals for .NET 5
Let me highlight some of the high-level goals for .NET 5:
- Unified .NET SDK experience:
- Single BCL (Base Class Library) across all .NET 5 applications. Today Xamarin applications use the Mono BCL but will move to use the.NET Core BCL, improving compatibility across our application models.
- Mobile development (Xamarin) is integrated into .NET 5. This means the .NET SDK will support mobile. For example, you can use “dotnet new XamarinForms” to create a mobile application.
- Native Applications supporting multiple platforms: Single Device project that supports an application that can work across multiple devices for example Window Desktop, Microsoft Duo (Android), and iOS using the native controls supported on those platforms.
- Web Applications supporting multiple platforms: Single Blazor project that supports an application that can work in browsers, on mobile devices and as a native desktop application (Windows 10x for example)
- Cloud Native Applications: High performance, single file (.exe) <50MB microservices and support for building multiple project (API, web front ends, containers) both locally and in the cloud.
- Continuous Improvements, such as: faster algorithms in the BCL, better support for containers in the runtime, support for HTTP3.
Today’s first preview does not contain all the work to support these high-level goals yet, but we will continue to announce more capabilities and features in future previews.
Improvements in Preview 1
The following improvements are in Preview 1:
Regular expression performance improvements
We’ve invested in significant improvements to the Regex engine. On many of the expressions we’ve tried, these improvements routinely result in throughput improvements of 3-6x, and in some cases, much more. We have a blog post coming shortly that will describe these improvements in much more detail.
Code quality improvements in RyuJIT
Every release includes a set of performance improvements to the code that the JIT generates. We refer to these type of improvements as “CQ” or code quality. In most cases, these improvements also apply to the code generated for ready-to-run images.
The following improvements are in preview 1:
- Improvements for null check folding – Remove the need to generate null checks in more cases by observing more patterns where null checks are provably unnecessary.
- Tuned common subexpression evaluation (CSE) – The JIT looks for and collapses duplicate expressions that only need to be evaluated once (wiki).
- Optimizing “constant_string”.Length – Optimizing this pattern and collapsing the code down to the correct integer value.
- JIT: build basic block pred lists before morph – Re-order phases in the JIT to allow key optimizations to be used earlier, resulting in better code quality and less work for the following phases, which increases JIT throughput (“TP” in the referenced PR).
Assembly load diagnostics added to event pipe
We have added assembly load information to event pipe. This improvement is the start of making similar diagnostics functionality available as is part of .NET Framework with the Fusion Log Viewer. You can now use dotnet-trace to collect this information, using the following command:
dotnet-trace collect --providers Microsoft-Windows-DotNETRuntime:4:4 --process-id [process ID]
The workflow is described in Trace Assembly Loading with Event Pipe. You can see assembly loading information for a simple test app.
Event pipe profiler APIs
Event pipe is a new subsystem and API that we added in .NET Core 2.2 to make it possible to perform performance and other diagnostic investigations on any operating system. In .NET 5.0, the event pipe has been extended to enable profilers to write event pipe events. This scenario is critical for instrumenting profilers that previously relied on ETW to monitor application behavior and performance.
GitHub repo consolidation
As part of the .NET 5 release, we reduced the number of GitHub repos we use to build and package .NET. Repo boundaries have a significant impact on many aspects of a project, including builds and issue management. With .NET Core 1.0, we had over 100 repos across ASP.NET, EF and .NET Core. With this latest release, we can now count the primary repos on one hand. We also moved nearly all repos to the dotnet org.
Check out the new, consolidated, repos:
- dotnet/runtime (was dotnet/corefx, dotnet/coreclr, and dotnet/core-setup)
- dotnet/aspnetcore (was several repos in the aspnet org)
- dotnet/sdk (was dotnet/sdk, dotnet/cli)
Closing
We hope that you are excited about the work that is happening with .NET 5! The best way to prepare for .NET 5 is to move all of our .NET Core applications to 3.1- we will make the transition from .NET Core 3.1 to .NET 5 as painless as possible. And if you are still building applications on .NET Framework, please feel safe leaving those applications on .NET Framework but think of using .NET Core 3.1 for all your new applications. There are lots of exciting things coming to .NET!
124 comments
Cool!
Is there support for UWP at this time (I’m assuming not)? When will that come?
+1
I have not got the following statement:
Native Applications supporting multiple platforms: Single Device project that supports an application that can work across multiple devices for example Window Desktop, Microsoft Duo (Android), and iOS using the native controls supported on those platforms.
What is difference between Xamarin.Forms solution ?
Does it mean that C# will compile to other platform specific formats aka Java byte code, native instructions and so on ?
It really just means we’re going to invest more in Xamarin.Forms.
Hello,
Is there any way today to run Xamarin.Forms app on Linux as it’s done today for Windows UWP. If not, do you have any plan for that?
Thank you.
Some oversight of Xamarin.Forms would make sense. Their approach maximizes bugs, via doing absolutely everything once per platform, taking on more and more new features. We’ve ended up only using the most basic elements because they have the greatest chance to work, but they are still somewhat buggy and bugs are created for core components as fast as they are fixed. I belive there is a need for a Xamarin.Forms.Core, a maintainable core library that works, with everything else in separate repos (Xamarin.Forms.XAML, Xamarin.Forms.CSS, Xamarin.Forms.Shell, etc.).
Any plan to run WPF applications in Linux desktop and macOS?
No. WPF will remain a Windows-only technology.
Do you have any recommendations(like Wine) to build desktop GUI apps for Linux with .NET core interoperability?
Scott , awesome news and well done. What about news on UWP’s interaction with .Net Core 3.1 / .Net 5 ?
Reading through the comments, this is the 3rd request for UWP info and no response. Also no mention of it by Scott in the post.
How I can install template for Xamarin?
dotnet new XamarinForms
does not work for me.
C:\Projects\NET5>dotnet –version
5.0.100-preview.1.20155.7
C:\Projects\NET5>dotnet new XamarinForms
Couldn’t find an installed template that matches the input, searching online for one that does…
Usage: new [options]
Options:
-h, –help Displays help for this command.
-l, –list Lists templates containing the specified name. If no name is specified, lists all templates.
-n, –name The name for the output being created. If no name is specified, the name of the current directory is used.
-o, –output Location to place the generated output.
-i, –install Installs a source or a template pack.
-u, –uninstall Uninstalls a source or a template pack.
–nuget-source Specifies a NuGet source to use during install.
–type Filters templates based on available types. Predefined values are “project”, “item” or “other”.
–dry-run Displays a summary of what would happen if the given command line were run if it would result in a template creation.
–force Forces content to be generated even if it would change existing files.
-lang, –language Filters templates based on language and specifies the language of the template to create.
–update-check Check the currently installed template packs for updates.
–update-apply Check the currently installed template packs for update, and install the updates.
No templates matched the input template name: XamarinForms.
You are running ahead of us! You’ll need to wait for a few more previews for that to happen. We’re just getting started with Preview 1.
Can I run a .Net 5 site in an Azure app service?
You can always publish as self-contained. We are already running a % of the .NET website traffic on Preview 1.
Just a quick question, do we have a VS preview version downloadable for Mac ? — just wanted to test out Xamarin with .Net 5
I don’t believe so. Way too early for that. Same with VS for Windows.
Hello Scott, thanks for the awaited update. So there is no chance for Asp .NET Web Forms, WCF and WF in .net 5.0, right? any chances they will be made open source, are you considering the idea? Thanks
Support for WPF Core and Winform Core??
Does F# have a special place in .NET 5?
Hey Arman, you can read about F# 5 preview 1, which we just shipped this week: https://devblogs.microsoft.com/dotnet/announcing-f-5-preview-1/
Wow, thank you. Pay more attention to this lovely language.