CLI Project Templates
- 3 minutes to read
CLI project templates allow you to create an empty DevExpress .NET MAUI application from a command line (both Windows and macOS). These templates are distributed as a NuGet package.
You can install these templates even if the .vsix templates are installed on your Windows machine. In this case, Visual Studio displays only the .vsix templates.
Important
You must register your personal NuGet feed for the solution to build correctly. If you are unfamiliar with NuGet packages, please review the following help topic: Install DevExpress Controls Using NuGet Packages.
Install Templates
Follow the steps below to install our CLI project templates:
Add the feed as a package source to your NuGet configuration files. To do this, create a
nuget.config
file with the following content:<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> <add key="DevExpress Nuget server" value="https://nuget.devexpress.com/{your-feed-url}/api/v3/index.json" /> </packageSources> </configuration>
Alternatively, you can use console commands:
# Register packages with an authorization key dotnet nuget add source https://nuget.devexpress.com/api/v3/index.json -n DXFeed -u DevExpress -p {your-feed-authorization-key} # Register packages with a feed URL dotnet nuget add source https://nuget.devexpress.com/{your-feed-url}/api/v3/index.json -n DXFeed
Note
Storing credentials in a NuGet.config file (especially when saving NuGet.config to your source control) is risky because it can lead to credential leakage. If you store credentials in NuGet.config, please consider using a more secure option as described in Consuming packages from authenticated feeds and How to Protect Your Private NuGet Feed and Safely Consume the Feed From External Systems.
Refer to the following topic for more information: Register DevExpress NuGet Gallery to Access Mobile UI for .NET MAUI.
An error can occur if the specified source is already in the source list. You can run
dotnet nuget list source
to view all configured sources and ensure that the specified andnuget.org
package sources are enabled. To enable them, use thedotnet nuget enable source
command.Call the following command in the terminal to install the DevExpress.Maui.ProjectTemplates NuGet package:
dotnet new install DevExpress.Maui.ProjectTemplates
Create a DevExpress MAUI Project
Open a command line tool in the folder where you want to create an application.
Run the following command:
dotnet new maui-dx -n MyDxFirstApp
The command above creates the MyDxFirstApp DevExpress .NET MAUI application. You can pass a custom name to that command.
Configure the Project
The command line includes the following optional parameters:
-n, --name <name>
The project name.
Default: parent folder name
-ap, --applicationId <applicationId>
The project application ID.
Default:
com.devexpress.<parent folder name>
-p, --product <choice>
DevExpress .NET MAUI Controls that should be used in the project.
Available Values:
charts - Uses DevExpress Charts.
collectionView - Uses DevExpress Collection View.
scheduler - Uses DevExpress Scheduler.
grid - Uses DevExpress Data Grid.
editors - Uses DevExpress Data Editors
dataForm - Uses DevExpress Data Form.
gauges - Uses DevExpress Gauges and Radial Progress Bar.
pdfviewer - Uses DevExpress PDF Viewer Control.
htmledit - Uses DevExpress HTML Edit Control.
treeview - Uses DevExpress TreeView Control.
Default: charts|collectionView|scheduler|grid|editors|dataForm|gauges|pdfviewer|htmledit|treeview
-local, --localization <choice>
Language resources to include in the project.
Available Values
- en - English
- de - German
- es - Spanish
- ru - Russian
- fr - French
Default: en|de|fr
--android
true
if this project should support Android; otherwise,false
.Default:
true
--ios
true
if this project should support iOS; otherwise,false
.Default:
true
Tip
You can type dotnet new maui-dx --help
to see available commands.