Want to move to .NET 5? In this session you'll see how to approach porting projects from .NET Framework, .NET Core, and .NET Standard to .NET 5 and the tools you can use to get there.
3. One .NET vision
.NET Framework
Mono / Xamarin
.NET Core.NET
Single SDK, one BCL, unified toolchain
Cross-platform native UI
Cross-platform web UI
Cloud native investments
Continue improvements in speed, size, diagnostics, Azure services
.NET has the best of breed solutions for all modern workloads
– .NET 5 to 6 "wave"
4. What does this actually mean?
.NET Framework 4.8
Mono / Xamarin
.NET Core 3.1 .NET Core 4.0.NET 5.0
No more features, only fixes
.NET 6
5. What is not in .NET 5?
• AppDomains, remoting, Web forms, WCF server and
Windows workflow remain on .NET Framework 4.8 only.
• There are no plans to port these.
Component Replacement
AppDomains AssemblyLoadContext
Remoting named pipes
gRPC
WebForms ASP.NET Blazor
WCF Server gRPC
Open source community project: https://github.com/CoreWCF/CoreWCF
WF Open source community project: https://github.com/UiPath/corewf
6. Simplified framework names in .NET 5
• net5.0. This is for code that runs everywhere. It combines
and replaces the netcoreapp and netstandard names.
• net5.0-windows (and later net6.0-android and net6.0-
ios). These TFMs represent OS-specific flavors of .NET 5 that
include net5.0 plus OS-specific functionality.
netX.Y-windows
netX.Y
netX.Y-android netX.Y-ios netX.Y-<os>
netcoreapp3.1
netstandard2.1
7. What will Microsoft libraries target?
Area Target Framework
Cross Platform Libraries
ASP.NET Core, EF, virtually all System.*
packages, most libraries
net5.0
Windows Controls
WinForms-, WPF-, and (managed) UWP controls
net5.0-windows
Cross Platform Abstractions
Xamarin Essentials, Xamarin Forms, MAUI, or
any other cross-platform abstraction
net5.0
And each OS-specific framework that it
provides implementations for
Cross Platform Libraries for .NET Framework
Azure SDK, Microsoft.Data.SqlClient and other
packages that need to support .NET Framework
netstandard2.0
8. What should you target?
• Continue to use netstandard2.0 to share
code between .NET Framework and all other
platforms.
• Consider using netstandard2.1 to share code
between Mono, Xamarin, and .NET Core 3.x
(less relevant with .NET 6).
• Use net5.0 for code sharing moving forward.
9. Porting to .NET 5
• Understand if you need to port at all
• Only port projects that you need to innovate in
• Maintenance-only projects can safely remain on
.NET Framework
• Make note of your desired target:
• .NET Core 3.1 vs. .NET 5
• Windows vs. MacOS vs. Linux
• Plan & ensure you have click stops
• So that you can keep shipping working software
2. Inventory
3. Convert Project
4. Move to .NET 5
5. Move to other OS
1. Understand goals
10. Porting to .NET 5
• Inventory your code and its dependencies
• Use API Port to do that
• Analyze your code for legacy
• Maybe you can drop that before porting
• Analyze your dependencies
• Ensure they offer support for .NET 5
3. Convert Project
4. Move to .NET 5
5. Move to other OS
1. Understand goals
2. Inventory
11. Porting to .NET 5
• Replace packages.config
• With <PackageReference> elements in the project
• Migrate the project files to SDK-style
• Use Try-Convert to automate this
• Consider only migrating the project files
• and not changing the target framework yet
• Click stops!
2. Inventory
4. Move to .NET 5
5. Move to other OS
1. Understand goals
3. Convert Project
12. Porting to .NET 5
• Understand your dependency graph
• Identify if you have shared components that needs
to continue to work on .NET Framework
• Retarget those to .NET Standard
• Retarget remainder to .NET Core 3.1 or
.NET 5
2. Inventory
3. Convert Project
5. Move to other OS
1. Understand goals
4. Move to .NET 5
13. Porting to .NET 5
• If you want to go cross-platform:
• Ensure you have a CI system that can support
multiple legs
• Azure DevOps, GitHub actions etc.
• Add a leg per operating system
• And run tests!
2. Inventory
3. Convert Project
4. Move to .NET 5
1. Understand goals
5. Move to other OS
15. Try-Convert Limitations
• It can’t convert some project types, such as
• ASP.NET
• Xamarin
• It doesn’t migrate any source code (*.cs), only project files
(*.csproj)
16. Docs!
We have docs that cover how to port to .NET 5
and what tools to use
https://aka.ms/net-porting-docs
17. API Port
Use it to assess understand your application
its dependencies, and how compatible they
are with .NET Core
$ dotnet tool install –g apiport
18. Try-Convert
Use it to convert your project files to .NET 5
and .NET Standard
dotnet tool install -g try-convert
19. Visual Studio 2019 16.8 GA and 16.9 Preview
visualstudio.com/download
aka.ms/vs-preview
Dev environments in the cloud .NET productivity
AI-assisted productivity
Automated CI/CD workflow Preview
Git workflows
Linux diagnostics
XAML productivity
• GitHub Codespaces available as a limited “preview”
for ASP.NET Core, .NET Core and C++
• Team Completions: Get C# contextual suggestions for
your own types, through custom models shared with
your team
• GitHub Actions workflow from within Visual Studio for
your .NET Core apps
• Easily execute your daily Git operations using the Git
Changes window
• Browse and manage your Git repository and stop
worrying about merge conflicts
• Roslyn analyzers are now included in the .NET 5.0 SDK
• .NET Code Style analyzers can now be enforced on build Preview
• .NET Core Debugging with WSL 2 using the
Linux distro of your choice Preview
• Debug managed Linux core dump
• XAML Binding Failures diagnostic
improvements
• XAML Hot Reload supports UWP
Animated slide
Our vision for one .NET is to simplify the platform and choices for .NET developers and provide a single stack that supports the best of breed solutions for all modern workloads.
Last year at Build, we laid out our vision for one .NET starting with .NET 5. We said we would take .NET Core and Mono/Xamarin implementations and unify them into one base class library (BCL) and toolchain (SDK). In the wake of the global health pandemic, we have had to adapt to the changing needs of our customers and provide the support needed to assist with smooth operations. Our efforts continue to be anchored in helping our customers address their most urgent needs. As a result, we expect these features to be available in preview for the .NET 5 release but the unification will be truly completed with .NET 6, our Long-Term Support (LTS) release. Our vision has not changed, but our timeline has.
.NET 5 will have several cloud & web investments, such as smaller, faster, single file EXEs that use less memory which are appropriate for microservices and containerized applications across operating systems. We will continue to build on the work we have done.
We are still committed to one .NET platform and delivering a quality .NET 5 release to our millions of users in November this year. You will continue to see a wave of innovation happening with multiple previews along the way on the journey to one .NET.