Create an ASP.NET Core Dashboard Application using the .NET CLI Project Template
- 3 minutes to read
You can use the .NET command-line interface (CLI) to create an application with the ASP.NET Core Dashboard control from the console.
Note
We implemented a new dotnet CLI-powered Project Wizard you can use across multiple IDEs: Cross-IDE Project Template Kit.
#Install DevExpress CLI Templates
Execute the following command to install DevExpress ASP.NET Core project templates from nuget.org:
dotnet new install DevExpress.AspNetCore.ProjectTemplates
If the NuGet.org package source is disabled, you will get the following error: NU1101: Unable to find package DevExpress.AspNetCore.ProjectTemplates. To see the list of sources and their status information, run the command dotnet nuget list source
. To enable a source, run the command dotnet nuget enable source <source name>
.
If you are new to NuGet, review An Introduction to NuGet for more information about package management prerequisites.
Note
DevExpress CLI project templates are also available in the DevExpress Nu
#Create a Project
To create an ASP.NET Core application with the Web BI Dashboard control, execute the following command:
dotnet new dx.aspnetcore.dashboard -n DashboardApp
The command creates an ASP.NET Core Dashboard application called DashboardApp in the current directory.
You can use the following parameters to see available command options: -? | -h | --help
. For example, execute the following command:
dotnet new dx.aspnetcore.dashboard --help
Refer to the following documents for information on template options:
- dotnet new command - Options
- Standard options for .NET CLI templates.
- Template Options
- Options specific to the DevExpress ASP.NET Core template.
#Run the Project
Navigate to the newly created application folder and use the following command to restore dependencies, run the application, and display the application’s URL:
cd DashboardApp
dotnet run
The command output contains the application URL, which can be different on different hosts:
Now listening on: http://localhost:5000
Open your browser and navigate to the URL specified in the command output to see the result.
The Web Dashboard application displays a sample dashboard and allows you to modify it, create a new dashboard and switch to Viewer mode:
#Template Options
The following list contains options you can specify when creating DevExpress ASP.NET Core Dashboard project templates:
-prerelease, --use-prerelease-dx-version
- A flag that indicates whether to use a pre-release DevExpress package version in the project.
--framework <TFM>
- Specifies the target framework. It expects a target framework moniker (TFM). Example:
net8.0
. --dx-version <version>
- Specifies DevExpress package version to be used in the project. Examples:
24.2.3
,24.2.*
,24.2.*-*
--dx-nuget-feed <feed>
- Specifies the NuGet Feed URL. Refer to nuget.devexpress.com to obtain your personal feed URL (available for registered users).
-ndd, --no-demo-data
- Specifies whether to create a project without a sample dashboard and predefined data source. |
#Next Steps
- Create Dashboards on the Web
- Describes how to create and configure dashboards in the Web Dashboard control.
- ASP.NET Core Dashboard Control
- Contains instructions on how to integrate the Dashboard control into an ASP.NET Core application.