Back to Devexpress

.NET CLI Integration

expressappframework-404967-installation-upgrade-version-history-dotnet-cli-integration.md

latest10.6 KB
Original Source

.NET CLI Integration

  • Oct 27, 2025
  • 7 minutes to read

You can use the .NET command line interface (CLI) to create XAF ASP.NET Core Blazor, Web API Service, and Windows Forms applications from the console (without using the DevExpress Template Kit and DevExpress Unified Component Installer). It is equivalent toTemplate Kit for .NET Core, but you can use it on any platform. This functionality is valuable for XAF developers who use Microsoft Visual Studio Code (VS Code) or JetBrains Rider in both Windows and non-Windows development environments (like Linux or MacOS).

This topic describes how to:

  • Install the DevExpress XAF Templates to create an XAF project from CLI.
  • Register the NuGet feed to access the required NuGet packages.
  • Create an XAF application.

Step 1. Install DevExpress XAF Templates

Download the DevExpress.XAF.ProjectTemplates NuGet package and install it. The package is available to everyone at https://www.nuget.org. Users with Universal subscription can find the package in their personal feed at https://nuget.devexpress.com.

console
dotnet new install DevExpress.XAF.ProjectTemplates

You can run the command below to see the list of available template options. These options are also described in detail in this article.

console
dotnet new dx.xaf -h

Step 2. Obtain Your NuGet Feed Credentials

You need to obtain your personal NuGet feed credentials to access the DevExpress.ExpressApp NuGet packages from your project. You can use NuGet feed URL or feed authorization key to manage DevExpress packages.

  1. Make sure your DevExpress.com account has access to XAF. This product line is included in the Universal subscription.

  2. Use your DevExpress credentials to log into nuget.devexpress.com.

  3. Obtain your NuGet feed credentials and copy them to the clipboard.

  4. Select DevExpress Online NuGet Feed as a NuGet Package Source.

Step 3. Create an Application

Run the following command to generate an XAF application:

console
dotnet new dx.xaf -p Blazor Win -e2e -api Standalone -n DXApplication1

The expected output project should be identical to a project generated by the Template Kit with the specified platforms and other default options.

If you create a standalone Web API Service project, the cross-platform module project code is inserted into its appropriate place in the Web API Service project.

Command Options

Specify the following command line parameters to customize the project:

Default dotnet new options:

-n, --name <name>Solution name. If omitted, the command uses the name of the output directory.-o, --output <output>Specifies the output directory.--dry-runDisplays a summary of what would happen if the given command line were run.--forceForces content to be generated even if it would change existing files.--no-update-checkDisables the check for the template package updates when instantiating a template.--project <project>The project that should be used for context evaluation.-lang, --language <C#>Specifies the template language to instantiate.--type <solution>Specifies the template type to instantiate.

Template options:

-nf, --nuget-feed <nuget-feed>Specifies the NuGet Feed URL. Refer to https://nuget.devexpress.com/#feed-url and login to your account to obtain your personal feed URL.-db, --database <SqlServer|SqlAzure|...>

Specifies the database provider for the solution.

SqlServer (default)Adds a connection for the Microsoft SQL Server database.SqlAzureAdds a connection for the Microsoft SQL Azure database.PostgreSqlAdds a connection for the PostgreSQL database.MySqlAdds a connection for the MySQL database.OracleAdds a connection for the Oracle database.FirebirdAdds a connection for the Firebird database.SqliteAdds a connection for the SQLite database.

If you need to create an application with EF Core and a database not mentioned above, create an application with EF Core and SQL Server database provider and update it manually as described in the following topic: Specify EF Core Database Provider in XAF Application.

-orm <EFCore|XPO>The target ORM for the solution.EFCore (Default)Adds the Entity Framework Core ORM.XPOAdds the XPO ORM.-dbu, --database-update <None|Auto|...>Configures whether ORM adds, modifies, and removes database objects if they do not match the data model structure. Auto (default)In Debug mode, automatically updates the database schema. Do not use with production databases or important data. NoneDisables database schema updates.ManualEnables manual ORM schema migrations via CLI. Refer to the following topic for more details: EF Core Migrations-p, --platformAdds a platform-specific project.BlazorAdds an ASP.NET Core Blazor XAF project.WinAdds a .NET Core Win XAF project.Default (Default)Adds an ASP.NET Core Blazor XAF project unless -api Standalone is specified. In this case, adds a Web API Service project.-e2eAdds a Functional Test project with EasyTest if true. The default value is false.``-api <Integrated|None|Standalone>Adds a Web API Service project.IntegratedAdds an integrated Web API Service to the ASP.NET Core Blazor project that is generated automatically if you did not specify it previously.StandaloneAdds a Web API Service project to the solution. The base module code is placed in the suitable place in the project if you did not specify any platform-specific project.None (default)Does not add anything.-s, --security <MiddleTier|OAuth2|Password|SSO|WinAD>Security options for the project. Multiple values are allowed.MiddleTierAdds a MiddleTier Web API Service project used by other platforms to access the database.OAuth2Adds OAuth2 authentication providers (for example, GitHub).Password (default)Adds standard password authentication.SSOEnables Single Sign-On authentication. Automatically enables the OAuth2 option and disables the Password and WinAD options.WinADAdds Windows Active Directory authentication.-mt, --multitenancyEnables Multi-Tenancy if true. The default value is false.-m, --modules <None|All|...>Adds XAF built-in modules to the project. Multiple values are allowed.NoneDoes not add any modules.AllAdds all modules available for your configuration.Default (default)Adds the Conditional Appearance and Validation Modules. For a standalone Web API Service project, adds the following modules: Audit Trail, Validation, File Attachments, and Reports V2.AuditAdds the ORM-specific Audit Trail Module.ChartsAdds the Windows Forms Chart Module.CloneAdds the XPO Clone Object Module.AppearanceAdds the Conditional Appearance Module.DashboardsAdds the Dashboards Module.FilesAdds the File Attachments ModuleNotificationsAdds the Notifications Module.OfficeAdds the Office Module (Rich Text Editor, Spreadsheet Editor, PDF Viewer) Module.PivotGridAdds the Windows Forms Pivot Grid Module.ReportsAdds the Reports V2 Module.SchedulerAdds the Scheduler Module.StateMachineAdds the State Machine Module.TreeListAdds the Windows Forms Tree List Editors Module.ValidationAdds the Validation Module.VariantsAdds the View Variants Module.

Note

The commands are case-insensitive.

Step 4. Run the Application

  1. Navigate to the application folder, build the application, and run the project:

  2. Open your browser and navigate to the URL to see your application.

  3. When you try to log in, the application should display the following message: “The application cannot connect to the specified database because the database doesn’t exist, its version is older than that of the application, or its schema does not match the ORM data model structure.” Run the -updateDatabase command to update your database. For more information, refer to the following article: Production Database and Application Updates. You can also create a database manually.