Skip to main content
All docs
V25.1
  • Create an ASP.NET Core Blazor Dashboard Application using the .NET CLI Project Template

    • 3 minutes to read

    You can use the .NET command-line interface (CLI) to create a Blazor Server or Blazor WebAssembly Hosted application with the 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 Blazor project templates from nuget.org:

    dotnet new install DevExpress.Blazor.ProjectTemplates
    

    If the NuGet.org package source is disabled, you will get the following error: NU1101: Unable to find package DevExpress.Blazor.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 NuGet Gallery (nuget.devexpress.com).

    Create a Project

    To create a Blazor application with the BI Dashboard control, execute the following command:

    Blazor Server
    dotnet new dx.blazor.dashboard -n DashboardApp
    
    Blazor WebAssembly Hosted
    dotnet new dx.blazor.dashboard -int Hosted -n DashboardApp
    

    The command creates a Blazor 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

    To run a Blazor Server, navigate to the application folder and execute the dotnet run command to restore dependencies and run the application:

    cd DashboardApp
    dotnet run
    

    For hosted Blazor WebAssembly applications, run the command from the DashboardApp.DashboardApp.Server folder:

    cd DashboardApp\DashboardApp.Server
    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:

    Web Dashboard - CLI Template

    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: 25.1.3, 25.1.*, 25.1.*-*
    --dx-nuget-feed <feed>
    Specifies the NuGet Feed URL. Refer to nuget.devexpress.com to obtain your personal feed URL (available for registered users).
    -int, --interactivity

    Specifies which hosting platform to use for the BI Dashboard Control.

    The default value is Server.

    Available options are:

    • Server

      Runs on the server.

    • Hosted

      Runs in the browser using WebAssembly with an ASP.NET Core app as a backend.

    -ndd, --no-demo-data
    Specifies whether to create a project without a sample dashboard and predefined data source.

    Next Steps

    Next Steps

    Create Dashboards on the Web
    Describes how to create and configure dashboards in the Web Dashboard control.
    Dashboard Component for Blazor
    Contains instructions on how to integrate the DxDashboard component into a Blazor application.
    Dashboard Backend
    Contains instructions that show how to configure the Web Dashboard on the server.