What Changed
XAF's Blazor and WinForms (.NET Core) v21.1 assemblies, demos and project templates target .NET 5 instead of .NET Standard 2.1 and .NET Core 3.0 respectively. To use .NET 5, you must first install Visual Studio 16.8 or higher.
NOTE: We also want to assure our existing .NET Framework XAF users (Windows Forms and ASP.NET Web Forms) that they are safe regardless of .NET Core/.NET 5 development - you can stay on .NET Framework and other Visual Studio versions as long as your business dictates. We will do our best to support you and address your needs along the way.
Reasons for Change
.NET Core 3 adoption was low because of missing design-time capabilities such as the Model Editor and Solution Wizard. With .NET 5, it is now possible to deliver the best design-time experience to XAF Blazor and WinForms customers from the point of the UX and performance. For instance, XAF v21.1 customers will be able to create a solution with both WinForms and Blazor apps for XPO or EF Core ORM using the new Solution Wizard (learn more).
.NET 5 will bring with it new capabilities, both for us and also for XAF users: CSS and JavaScript Isolation, new Microsoft Identity Web packages for the latest Azure Active Directory SDK, performance and debugging enhancements, etc. For more information on this topic, please review these Microsoft articles: The future of .NET Standard | What's new in ASP.NET Core 5.0 | Migrate from ASP.NET Core 3.1 to 5.0.
Impact on Existing Apps
Semi-Automatic Migration with the Project Converter (recommended)
To simplify the migration process, the DevExpress Project Converter will attempt to re-target your XAF projects to .NET 5 automatically. Important Note: Our Project Converter will not update your non-XAF projects, custom dependencies, or code. You will still need to complete .NET 5 migration manually. For more information, see Breaking Changes in .NET 5 | Migrate from ASP.NET Core 3.1 to 5.0.
Although your SolutionName.Module (as well as other platform-agnostic modules) can still target .NET Standard or .NET Core, we also recommend that you update them to .NET 5. The only reason to have your SolutionName.Module
on .NET Standard is to reuse it in .NET Framework or other .NET Standard modules. Example: we used a .NET Standard 2.0 platform-agnostic module with XAF WinForms, ASP.NET WebForms and ASP.NET Core Blazor Server apps at XAF - How to show the number of nested List View items in tab captions.
Tip: To reference a module in multiple apps/libraries for different target frameworks, use Cross-platform targeting or Multi-Targeting. This approach will help you avoid two CSPROJ files for different Target Frameworks - less code duplication and maintenance costs for your solution. To make it work, the CSPOJ file defines TargetFrameworks element and required dependencies for each target conditions:
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
.
Manual Migration
Scenario 1. WinForms .NET Core
Make sure that your SolutionName.Module.Win
and SolutionName.Win
projects (as well as related WinForms .NET Core modules) target net5.0-windows
:
XML<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>
Scenario 2. XAF Blazor .NET Core
2.1. Make sure that your SolutionName.Module.Blazor
project target net5.0
and Microsoft.NET.Sdk.Razor
:
XML<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
2.2. Make sure that your SolutionName.Blazor.Server
project (as well as related Blazor .NET Core modules) target net5.0
and Microsoft.NET.Sdk.Web
:
XML<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
Troubleshooting
If you received the Package DevExpress.ExpressApp.XXX was restoring using .NETFramework,Version=YYY instead of the project target framework .NETCoreApp,Version=v3.1. This package may not be fully compatible with your project
error, you likely did not re-target your project from .NET Core 3 to .NET 5 (please review the scenarios above).
See Also
.NET Core Desktop Development (WPF & WinForms): Changes in Installation and NuGet Package Content