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/or ASP.NET application
    ApplicationSolutionStructure
  • .NET Core 3.0+ WinForms application
  • .NET Core 3.0+ Blazor application

Projects

  • 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

    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 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-specific code, or an editor that creates an ASP.NET control.

  • Blazor Module Project

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

  • 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 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

    Contains code specific to your application’s 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, and 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.

In solutions with .NET Framework projects, if you do not need the WinForms or ASP.NET 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