Skip to main content
A newer version of this page is available. .

Application Solution Structure

  • 3 minutes to read

A typical XAF solution consists of several projects. This topic describes all the projects a typical XAF solution contains and shows where to add your code when developing an application.

The Solution Wizard allows you to create one of the following solutions:

  • .NET Framework 4.5.2+ WinForms and ASP.NET Web Forms application
    application solution structure .net framework
  • .NET 5 WinForms and ASP.NET Core Blazor application
    application solution structure .net 5

Projects

Module Project (.NET Framework & .NET 5+)

module project

Use this assembly to implement UI-independent application elements. For example, you can define a business model and implement UI-independent Controllers. Subsequently, your applications have a similar business model and similar controllers.

To declare a new class in a module project, add a new code file using the Add New Item dialog. Use a special template (Business Object, View Controller or Window Controller) to create a business class or Controller.

WinForms Module Project (.NET Framework & .NET 5+)

WinForms Module Project

Use this assembly to implement application elements only for the WinForms application version. For instance, you can implement a Controller that includes WinForms-specific code, or an editor that creates a WinForms control.

ASP.NET Web Forms Module Project (.NET Framework)

ASP.NET Web Forms Module Project

Use this assembly to implement application elements only for the ASP.NET Web application version. For instance, you can implement a Controller that includes ASP.NET Web Forms-specific code, or an editor that creates an ASP.NET Web Forms control.

Blazor Module Project (.NET 5+)

Blazor Module Project

Use this assembly to implement application elements only for the ASP.NET Core Blazor application version. For instance, you can implement a Controller that includes ASP.NET Core Blazor-specific code, or an editor that creates an ASP.NET Core Blazor component.

WinForms Application Project (.NET Framework & .NET 5+)

WinForms Application Project

Contains code specific to your application’s WinForms version. Usually, only the Program.cs (Program.vb) and WinApplication.cs (WinApplication.vb) files can be modified. Avoid adding business classes, editors or Controllers to this project - XAF cannot automatically discover those items and add them to your application. The best location for these items is one of the Module projects that define the application’s logic.

ASP.NET Web Forms Application Project (.NET Framework)

ASP.NET Web Forms Application Project

Contains code specific to a browser-based interface. Usually, only the Global.asax.cs (Global.asax.vb) and WebApplication.cs (WebApplication.vb) files can be modified. Avoid adding business classes, editors or Controllers to this project - XAF cannot automatically discover those items and add them to your application. The best location for these items is one of the Module projects that define the application’s logic.

Blazor Application Project (.NET 5+)

Blazor Application Project

Contains code specific to your application’s ASP.NET Core Blazor version. Usually, only the Program.cs, BlazorApplication.cs, and Startup.cs files can be modified. Avoid adding business classes, editors or Controllers to this project - XAF cannot automatically discover those items and add them to your application. The best location for these items is one of the Module projects that define the application’s logic.

Important Notes

WinForms, ASP.NET Web Forms, and ASP.NET Core Blazor applications can be built based on the same business model, business logic, and Controllers. This takes place if all applications use the same set of modules.

If you do not need the WinForms, Blazor, or ASP.NET Web Forms application version, you can delete the corresponding project from the solution. In this instance, the most straightforward application can contain at least two projects: the application project and the module.

You can also create a platform-specific solution with three projects: an application project, a module project, and a UI-specific module project.

Optionally, your XAF solution may include the Application Server Project, Workflow Server Project and any other custom projects you create.

See Also