Back to Devexpress

Register a Built-in XAF Module

expressappframework-118047-app-shell-and-base-infrastructure-application-solution-components-modules-register-buil-in-xaf-module.md

latest18.7 KB
Original Source

Register a Built-in XAF Module

  • Feb 21, 2026
  • 3 minutes to read

XAF includes a number of ready-to-use built-in modules. This topic describes how to register a built-in module in a new or existing XAF application.

Register a Built-in XAF Module in an Existing Application

  1. Install the NuGet package that contains the module.
  2. Navigate to the MyApplication.Blazor.Server\Startup.cs (Blazor) or MyApplication.Win\Startup.cs (WinForms) file and call the module-related Add* method to register the module.

The following code samples register Reports, Dashboards, and Office modules in the application.

csharp
public class Startup {
   // ...
   public void ConfigureServices(IServiceCollection services) {
         // ...
         services.AddXaf(Configuration, builder => {
            // ...
            builder.Modules
               .AddReports(/*...*/)
               .AddDashboards(/*...*/)
               .AddOffice(/*...*/)
            // ...
         });
   }
}
csharp
public class ApplicationBuilder : IDesignTimeApplicationFactory {
   public static WinApplication BuildApplication(string connectionString) {
         // ...
         builder.Modules
            .AddReports(/*...*/)
            .AddDashboards(/*...*/)
            .AddOffice(/*...*/)
         // ...
   }
   // ...
}

Display the list of module NuGet packages and AddModule methods

ModuleNuGet PackagesModule-Related Methods
Audit Trail ModuleDevExpress.ExpressApp.AuditTrail.EFCore
DevExpress.ExpressApp.AuditTrail.XpoAddAuditTrailEFCore
AddAuditTrailXpo
Chart ModuleDevExpress.ExpressApp.Chart.WinAddCharts (WinForms)
Clone Object ModuleDevExpress.ExpressApp.CloneObject
DevExpress.ExpressApp.CloneObject.XpoAddCloning
ConditionalAppearanceDevExpress.ExpressApp.ConditionalAppearanceAddConditionalAppearance
Dashboards ModuleDevExpress.ExpressApp.Dashboards.Blazor
DevExpress.ExpressApp.Dashboards.WinAddDashboards (Blazor)
AddDashboards (WinForms)
File Attachments ModuleDevExpress.ExpressApp.FileAttachment.Blazor
DevExpress.ExpressApp.FileAttachment.WinAddFileAttachments (Blazor)
AddFileAttachments (WinForms)
Multi-Tenancy (Data per Tenant) ModuleDevExpress.ExpressApp.MultiTenancy.Blazor.EFCore
DevExpress.ExpressApp.MultiTenancy.Blazor.XPO
DevExpress.ExpressApp.MultiTenancy.Win.EFCore
DevExpress.ExpressApp.MultiTenancy.Win.XPOAddMultiTenancy (EF Core Blazor)
AddMultiTenancy (XPO Blazor)
AddMultiTenancy (EF Core WinForms)
AddMultiTenancy (XPO WinForms)
Notifications ModuleDevExpress.ExpressApp.Notifications.Blazor
DevExpress.ExpressApp.Notifications.WinAddNotifications (Blazor)
AddNotifications (WinForms)
Office ModuleDevExpress.ExpressApp.Office.Blazor
DevExpress.ExpressApp.Office.WinAddOffice (Blazor)
AddOffice (WinForms)
Pivot Grid ModuleDevExpress.ExpressApp.PivotGrid.WinAddPivotGrid (WinForms)
Reports V2 ModuleDevExpress.ExpressApp.ReportsV2.Blazor
DevExpress.ExpressApp.ReportsV2.WinAddReports (Blazor)
AddReports (WinForms)
Scheduler ModuleDevExpress.ExpressApp.Scheduler.Blazor
DevExpress.ExpressApp.Scheduler.WinAddScheduler (Blazor)
AddScheduler (WinForms)
State Machine ModuleDevExpress.ExpressApp.StateMachineAddStateMachine
TreeList Editors ModuleDevExpress.ExpressApp.TreeListEditors.WinAddTreeListEditors (WinForms)
Validation ModuleDevExpress.ExpressApp.Validation.Blazor
DevExpress.ExpressApp.Validation.WinAddValidation (Blazor)
AddValidation (WinForms)
View Variants ModuleDevExpress.ExpressApp.ViewVariantsModuleAddViewVariants

Register a Module in the Module Project

You can use the ModuleBase.RequiredModuleTypes property to specify required dependencies for your module. XAF loads these dependent modules with the current module. Follow the steps below to register additional modules in the Module project:

  1. Install the NuGet package that contains the module to register.
  2. Add additional modules to the RequiredModuleTypes list in the MyApplication.Module\Module.cs file.
csharp
public sealed class _MyApplicationModule : ModuleBase {
   //...
   public _MyApplicationModule() {
      InitializeComponent();
      this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.SystemModule.SystemModule));
      this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.ReportsV2.ReportsModuleV2));
      this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.Dashboards.DashboardsModule));
      this.RequiredModuleTypes.Add(typeof(DevExpress.ExpressApp.Office.OfficeModule));
      // ...
   }
}

Display the list of module types and NuGet packages

ModuleNuGet PackagesModule Type
Audit Trail ModuleDevExpress.ExpressApp.AuditTrail.EFCore
DevExpress.ExpressApp.AuditTrail.XpoAuditTrailModule
Chart ModuleDevExpress.ExpressApp.ChartChartModule
Clone Object ModuleDevExpress.ExpressApp.CloneObject
DevExpress.ExpressApp.CloneObject.XpoCloneObjectModule
ConditionalAppearanceDevExpress.ExpressApp.ConditionalAppearanceConditionalAppearanceModule
Dashboards ModuleDevExpress.ExpressApp.DashboardsDashboardsModule
Notifications ModuleDevExpress.ExpressApp.NotificationsNotificationsModule
Office ModuleDevExpress.ExpressApp.OfficeOfficeModule
Pivot Grid ModuleDevExpress.ExpressApp.PivotGridPivotGridModule
Reports V2 ModuleDevExpress.ExpressApp.ReportsV2ReportsModuleV2
Scheduler ModuleDevExpress.ExpressApp.SchedulerSchedulerModuleBase
State Machine ModuleDevExpress.ExpressApp.StateMachineStateMachineModule
TreeList Editors ModuleDevExpress.ExpressApp.TreeListEditorsTreeListEditorsModuleBase
Validation ModuleDevExpress.ExpressApp.ValidationValidationModule
View Variants ModuleDevExpress.ExpressApp.ViewVariantsModuleDevExpress.ExpressApp.ViewVariantsModule

Add a Built-in XAF Module in a New Application

You can add modules to your application when you use the Template Kit to create a new XAF solution. Select modules in the Additional Modules section.

See Also

Best practices for creating reusable XAF modules with a View Variants module extension

How to Register DI Services in a Custom Module with Application Builder Extensions