Skip to main content
A newer version of this page is available. .

Create an ASP.NET Core Dashboard Application using the .NET Core CLI Tools

  • 2 minutes to read

You can use the .NET Core command-line interface (CLI) tools to create a sample application with the ASP.NET Core Dashboard control:

  1. Install the DevExpress .NET project templates:

    dotnet new -i DevExpress.DotNet.Web.ProjectTemplates::21.1.12
    

    After installation is completed you see a list of available templates.

  2. Create and open a project folder:

    mkdir asp-net-core-dashboard-project
    cd asp-net-core-dashboard-project
    
  3. Go to nuget.devexpress.com, copy your DevExpress NuGet Feed URL. The API Key used in the URL is specific to your developer account. Each licensed developer should obtain their own Feed URL / API Key.

  4. Use the dx.dashboard short name with the -nf (–nuget-feed) option to create the ASP.NET Core Dashboard template. The -nf (–nuget-feed) option is used to specify DevExpress NuGet Feed URL from the step 3:

    dotnet new dx.dashboard -nf https://nuget.devexpress.com/<API Key>/api
    

    This creates the ASP.NET Core 3.1 Dashboard application with the latest NuGet and NPM packages. It is recommended to explicitly specify the .NET Core framework and packages version. Use the following options:

    Option Description
    -pv, --packages-version Sets a specific version of the DevExpress Dashboard NuGet and npm packages.
    -f, --framework Specifies the target framework for the project:
    - netcoreapp2.1 - The target framework is .NET Core 2.1
    - netcoreapp3.1 - The target framework is .NET Core 3.1 (default)
    - net5.0 - The target framework is .NET 5

    The code snippet below creates the ASP.NET Core 5 Dashboard template with 21.1.12 packages:

    dotnet new dx.dashboard -nf https://nuget.devexpress.com/<API Key>/api -pv 21.1.12 -f net5.0
    
  5. Run the project:

    dotnet run
    

    The project starts listening on the http://localhost:5000. Open it in the browser to see the result.

    The Web Designer application displays a sample dashboard and allows you to change it, create a new dashboard and switch to Viewer mode. Optionally, you can create the dashboard template without a sample dashboard and predefined data source. For this, use the -ndd (--no-demo-data) option:

    dotnet new dx.dashboard -nf https://nuget.devexpress.com/<API Key>/api -ndd true
    

Another quick way to create an ASP.NET Core Dashboard application is to use the DevExpress Template Gallery.

Next Steps

See Also