Skip to main content
All docs
V23.2

Create a Solution

  • 3 minutes to read

This lesson guides you through the XAF Solution Wizard. In the Wizard, you will complete the following steps:

  • Add two projects to the solution: ASP.NET Core Blazor and Windows Forms.
  • Select an ORM tool to use for data management.
  • Turn on user authentication.
  • Review available built-in modules and enable the Validation module.

This lesson also describes how to use migrations to update your database schema after you change the application’s data model or how to force your application to work with an in-memory database (during the development/debugging phase).

At the end of this lesson, you can run the application for the first time.

Step-by-Step Instructions

  1. From Visual Studio’s main menu, select File | New | Project… to invoke the Create a new project dialog.

    Create a new XAF project

  2. Select DevExpress v23.2 XAF Template Gallery and click Next.

    Select XAF Template Gallery, DevExpress

  3. Specify the project’s name (MySolution) and click Create.

    Specify Solution name, DevExpress

  4. In the invoked Template Gallery window, switch to the .NET section. Select XAF Solution Wizard (.NET 6) and click Run Wizard.

    Select "XAF Solution Wizard (.NET Core)" in the Template Gallery

  5. On the first page of the Solution Wizard, you can select target platforms. Select two options - Desktop (Windows Forms) and Web (ASP.NET Core Blazor). Click Next.

    Select the "Web (ASP.NET Core Blazor)" platform

  6. Choose the Entity Framework Core ORM library.

    Select the ORM tool

    Tip

    For additional information on how to choose an ORM that suits your needs, refer to the following topic: Why We Recommend EF Core over XPO for New Development.

  7. In the next window, you can enable XAF’s functional testing and multitenancy capabilities. Do not select anything and continue to the next step since these options are not required for this tutorial.

    Skip Functional Testing and Multitenancy, DevExpress

  8. Choose the authentication type for your application. In this tutorial, we implement user authentication at a later stage. Choose None and click Next.

    Select

  9. Select the ready-to-use XAF modules you want to add to your application. This tutorial requires the Validation module. Click Finish.

    Select "Validation" module

Solution Structure

The solution contains the following projects:

MySolution.Module
A module project that contains platform-independent code. Use this project to define the business logic that applies to all target platforms.
MySolution.Blazor.Server
An ASP.NET Core Blazor application that generates a user interface based on the business logic you define in MySolution.Module.
MySolution.Win
A WinForms application that generates a user interface based on the business logic you define in MySolution.Module.

Solution Explorer view

Refer to the Application Solution Structure topic for information on the XAF solution structure.

Database Connection

When you create a new application, the application wizard attempts to find an installed Microsoft SQL Server instance (LocalDB or Express) and sets the connection string accordingly. You can also connect to a different database system as described in the following topic: Connect an XAF Application to a Database Provider.

First Run

You can now run the application. Click Start Debugging or press F5.

The ASP.NET Core Blazor project is set as the startup project. To run the Windows Forms application, right-click the MySolution.Win project in the Solution Explorer and select the Set as Startup Project item from the context menu.

The following images show the resulting ASP.NET Core Blazor and Windows Forms applications.

ASP.NET Core Blazor
ASP.NET Core Blazor application first run
Windows Forms
Windows Forms application first run

Next Lesson

Implement a Data Model: Basics