Skip to main content

Solution Wizard

  • 5 minutes to read

XAF features the Solution Wizard, which allows you to create a new application in a few steps. The wizard allows you to:

The wizard generates a solution according to the specified settings.

The Solution Wizard is available when you add a new project.

  1. In the Add a new project dialog, find the DevExpress v24.2 XAF Template Gallery and click Next.

    SolutionWizardTemplate

  2. Configure your new project and click Create to invoke the Template Gallery.
  3. In the Template Gallery, select the following options:

    • .NET framework
    • C# programming language
    • XAF Solution Wizard (.NET)

    Click Run Wizard.

    XAF Solution Wizard

Tip

You can also run the Solution Wizard from the DevExpress Template Gallery. To find the wizard, choose XAF in the Platform combo box.

Step 1 – Choose the Target Platforms

In this step, you can select:

  • For the .NET Framework solution: Desktop (Windows Forms), Web (ASP.NET Web Forms), or multiple applications at once.
  • For the .NET solution: Desktop (Windows Forms), Web (ASP.NET Core Blazor), Service (ASP.NET Core Web API), or multiple applications at once.

CTutor_Solution_Wizard_1

The wizard will add the required platform-specific application and module projects.

Step 2 – Choose the ORM

In this step, you can choose your data model type: EF Core ORM or XPO ORM.

SolutionWizard_Step2

The wizard will add code that registers an appropriate Object Space Provider (see XafApplication.ObjectSpaceProvider). If you choose Entity Framework Code First or Entity Framework Core, the wizard will generate the DbContext class code.

Step 3 – Enable End-to-End Tests, Multitenancy, and Central Package Management (CPM)

In this step, you can add the following functionality:

  • Functional Tests - write end-to-end tests in C# with xUnit.
  • Multitenancy - implement multi-tenant or SaaS-ready applications.
  • NuGet Central Package Management (CPM) - create an XAF application with the Directory.Packages.props file to simplify the management of common dependencies across all projects within a solution.
    Versions of third-party NuGet packages within the Directory.Packages.props file of your XAF solution are based on the latest version compatible with the target framework (over 100 known packages, the full list is available at C:\Program Files\DevExpress 24.2\Components\Sources\DevExpress.ExpressApp\Directory.Packages.props). Our Project Converter can automatically update the solution’s Directory.Packages.props file.

Solution Wizard - Step 3

Step 4 – Enable the Security System and Choose the Authentication Type

In this step, you can enable the Security System and select the authentication type.

SolutionWizard_Step3.1

If you selected Desktop (Windows Forms) in the previous steps, you can also choose the client-side security mode or set up the middle-tier security.

Solution Wizard - Step 4

The wizard adds code that configures the Security System and populates the data model with the entities required to persist Security System data (users, roles, and permissions). If you choose Standard authentication, it also adds code that creates the “Admin” user with an empty password to the Updater.cs (Updater.vb) file. If you choose Active Directory authentication, a similar code is added, but the user is taken from your current Windows account.

With the Security System enabled, the wizard also adds the code demonstrated in the How to: Store the Application Model Differences in the Database topic. This code configures the Database Model Difference Storage in both WinForms and ASP.NET Web Forms modules.

Step 5 – Choose Additional Modules

In this last step, you can choose the XAF additional modules to include.

SolutionWizard_Step4

The wizard will register the selected modules and add the entities required by these modules to the data model.

Result

The following image demonstrates the generated solution.

SolutionWizard_Studio

Note

The wizard attempts to detect your installed SQL server and changes the connection string accordingly. Supported servers are Microsoft SQL Server (including the Express and LocalDB editions). To use another database system (PostgreSQL, MySQL, Oracle, SQLite, Firebird, etc.), change the ConnectionString argument in the App.config and Web.config files of the WinForms/ASP.NET Web Forms application projects. Refer to the Connect an XAF Application to a Database Provider topic for details about connecting to different database systems.

Add a Project to an Existing XAF Solution

You can also run the Solution Wizard for an existing solution to create additional XAF projects. Right-click the solution in the Solution Explorer, choose Add | New Project… and select DevExpress v24.2 XAF Template Gallery and click Next. In the Template Gallery, select the newly added project settings and click Run Wizard. The image below shows the Wizard’s start page in this case.

Wizard_Project

The table below lists the available projects and their descriptions.

Template Name

Description

See Also

Windows Forms App

Generate an XAF-powered Windows Forms projects for desktop application development (.NET Framework | .NET).

ASP.NET Core Blazor App

Generate an XAF-powered ASP.NET Core Blazor Server projects for web application development (.NET).

ASP.NET Web Forms Application Project

Generate an XAF-powered ASP.NET Web Forms projects for web application development (.NET Framework).

ASP.NET Core Web API Service

Generate an ASP.NET Core Web API Service project to reuse existing data models and Security System settings (users, roles, and permissions) stored in an XAF application database in the non-XAF .NET application.

Middle Tier Security (Windows Forms only)

Create a Middle Tier App Server project to secure database access for XAF-powered Windows Forms client apps using the XPO ORM (.NET Framework).

Reusable Module Library

Create a Class Library project to reuse data model, business logic, UI elements, and settings within XAF-powered apps and modules (.NET Framework | NET 6).

Workflow App Server

Create a Workflow App Server project to start long-running processes as workflows within XAF-powered apps using the Windows Workflow Foundation (.NET Framework).

End-to-End Testing Project

Creates an end-to-end (functional) testing project (.NET Framework | .NET).