Skip to main content
All docs
V24.1

Create a Combined .NET WinForms and Blazor Solution

  • 2 minutes to read
  1. In Visual Studio, create a new project. Select the DevExpress v24.1 XAF Template Gallery project template and click Next. Specify the new solution’s name and location. Then, click Create.

    Create a Project

  2. Select the .NET Core platform and run the XAF Solution Wizard.

    Launch the Wizard

  3. In the invoked Solution Wizard, select the Desktop (Windows Forms) and Web (ASP.NET Core Blazor) platforms and click Next.

    Select a Platform

  4. Choose the Entity Framework Core (EF Core) or XPO ORM on the next step.

    Choose the ORM

  5. Choose the security options of your application.

    Choose the security options

  6. Choose the XAF modules, which are automatically added to your application and click Finish.

    Choose the XAF modules

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.