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

DevExpress Templates (NuGet CLI)

  • 3 minutes to read

Important

Ensure your system meets these requirements.

This topic describes how to:

You can execute CLI commands in any command line interpreter: Command Prompt (CMD), Visual Studio Code and macOS terminals, and others.

1. Install DevExpress Templates

Download the DevExpress.Blazor.ProjectTemplates NuGet package and install it.

dotnet new -i DevExpress.Blazor.ProjectTemplates

After the installation is completed, the following DevExpress project templates are available:

Template list

2. Obtain Your DevExpress NuGet Feed Credentials

You need to obtain your personal NuGet feed credentials to access the DevExpress.Blazor NuGet package 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 Blazor UI Components. This product line is included in the Universal, DXperience, and ASP.NET subscriptions. Refer to the subscription comparison matrix for more information.

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

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

    NuGet Feed

    You can find the same URL in the Download Manager.

3. Register the NuGet Feed as a Package Source

Add the feed as a package source to your NuGet configuration files. To do this, create the nuget.config file with the following content:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="MyGet" value="https://api.nuget.org/v3/index.json" />
    <add key="DevExpress Nuget server" value="https://nuget.devexpress.com/{your-feed-url}/api" />
  </packageSources>
</configuration>

Alternatively, you can use console commands:

# Register packages with an authorization key
dotnet nuget add source https://nuget.devexpress.com/api -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 -n DXFeed

Refer to the following topic for more information: Manage Packages with .NET CLI.

An error can occur if the specified source is already in the source list. You can run dotnet nuget list source to view all the configured sources and ensure the specified source and the nuget.org package source are enabled. To enable them, use the dotnet nuget enable source command.

4. Create a New Project

Create and open a project folder:

mkdir my-blazor-project
cd my-blazor-project

Run one of the following commands to create a project:

  • DevExpress Blazor Server App:

    dotnet new dxblazorserver -n MyBlazorServerProject
    
  • DevExpress Blazor WebAssembly App

    dotnet new dxblazorwasm -n MyBlazorWasmProject
    
  • DevExpress Blazor Hosted WebAssembly App

    dotnet new dxblazorwasmhosted -n MyBlazorWasmHostedProject
    

The newly created project references the DevExpress.Blazor NuGet package. NuGet automatically restores this package if you registered the DevExpress NuGet feed.

Note

You can also pass the NuGet feed as a -nf parameter when you create a project.

dotnet new dxblazorserver -n MyBlazorServerProject -nf https://nuget.devexpress.com/{your-feed-url}/api

The command creates the project and adds the NuGet.config file with the DevExpress feed to the project folder.

5. Run the Application

Run a Server or WebAssembly application:

dotnet run

Run a hosted WebAssembly application:

cd App.Server
dotnet run

The project starts listening on https://localhost:5000. Open it in the browser.

Run the application

6. Add More DevExpress Components

For instructions on how to add an individual DevExpress Blazor component to your application, refer to the documents below: