Skip to main content
All docs
V23.2

Add a New .NET 6+ XAF Module to an XAF Application

  • 2 minutes to read

In the Solution Explorer, right-click the Solution item. In the context menu, select Add DevExpress Item and launch the XAF Solution Wizard.

Launch the XAF Solution Wizard

Use this wizard to add a new Reusable Module Library project.

Add a new XAF project

Target Multiple .NET Platforms in a Single XAF Shared Module Project

Use Cross-platform targeting to reference a module in multiple applications or libraries for different target frameworks. This technique helps you avoid two .CSPROJ files for different Target Frameworks. A single .CSPROJ file defines the TargetFrameworks element and required dependencies for each target condition: <TargetFrameworks>net8.0;net48</TargetFrameworks>

We recommend this multi-targeting solution for both typical situations, where your shared XAF Module or Class Library project (SolutionName.Module) currently targets .NET Framework (<TargetFramework>net48;/TargetFramework>) or .NET Standard 2.0 (<TargetFramework>netstandard2.0;/TargetFramework>).

Example

If you used .NET Standard 2.0 to share code between .NET Framework and all other .NET implementations, here is a simple change that you will need to make to your cross-platform library (.CSPROJ) that supported .NET Standard in v23.1 (or earlier versions), when you upgrade its DevExpress dependencies to v23.2+.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <!-- BEFORE (v23.1 and older)-->
    <!-- <TargetFramework>netstandard2.0;/TargetFramework> -->
    <!-- AFTER (v23.2 and newer) -->
    <!-- Your shared Class Library will output net8.0 and net48 assemblies -->
    <TargetFrameworks>net8.0;net48</TargetFrameworks>
  </PropertyGroup>
</Project>

Also attached are complete sample projects for your reference. For more information, review this Breaking Change notice.