Breaking Change T985962
Visible to All Users

Core - XAF's Blazor and WinForms (.NET Core) assemblies target .NET 5

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.
Clipboard-File-2.png

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).
Clipboard-File-1.png

See Also

.NET Core Desktop Development (WPF & WinForms): Changes in Installation and NuGet Package Content

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.