Skip to main content
All docs
V25.2
  • Create a Project from the Command Line

    • 3 minutes to read

    You can use the .NET command-line interface to create DevExpress-powered Blazor projects.

    Prerequisites

    Obtain your personal NuGet feed credentials to access the DevExpress.Blazor NuGet package from your project. You can use the NuGet feed URL or feed authorization key to manage DevExpress packages.

    Install DevExpress Blazor Templates

    DevExpress Blazor project templates are included in our Unified Component Installer.

    You can also install the templates from nuget.org or the DevExpress NuGet Gallery (nuget.devexpress.com). If you are new to NuGet, visit the following page for more information about package management prerequisites: An Introduction to NuGet.

    If you get the NU1101: Unable to find package DevExpress.Blazor.ProjectTemplates error, check whether the nuget.org source is enabled. To list sources with their status, run dotnet nuget list source. To enable a source, run dotnet nuget enable source <source name>.

    Create a Blazor Project

    Run the following command to create a blank Blazor project in the current directory:

    dotnet new dx.blazor -n <project name>
    

    Command Line Parameters

    All command-line parameters are case-insensitive.

    Tip

    For a complete list of commands and options, run dotnet new dx.blazor with any of the following flags: -?, -h, or --help.

    dotnet new dx.blazor -h
    

    Project Parameters

    -n, –name <name>
    Solution name. If omitted, the command uses the output directory name.
    -o, –output <directory>
    Specifies the output directory.
    –project <project>
    The project that should be used for context evaluation.
    -lang, –language <programming language>
    Specifies the template’s programming language (for example, C#).
    –type <template type>
    Specifies the template type (project or solution).

    Template Options

    -f, –framework <target framework moniker>
    The target .NET framework version.
    -int, –interactivity <interactive render mode>
    Specifies the render location for interactive components.
    -ai, –all-interactive
    Makes every page interactive (applies interactive render mode at the top level). If omitted, pages use static server rendering by default and can be marked interactive on a per-page or per-component basis.
    -au, –auth <authentication type>
    Specifies the authentication scheme in the generated project.
    –add-views <space-separated view names>
    Generates sample pages for DevExpress Blazor components. Registers component packages, required static resources, and mock data. Separate multiple view names with spaces.
    –add-ai-resources <AI service>
    Registers the specified AI service for DevExpress AI-powered components and extensions.
    -th, –theme <theme>
    Chooses a built-in DevExpress theme or a Bootstrap theme.
    -sz, –size <size mode>
    Specifies the global size mode for DevExpress Blazor components. Individual component settings can override this option in code.
    –add-bootstrap
    Includes the Bootstrap CSS file to the project and references it in the root layout file.
    –add-open-iconic
    Includes Open Iconic resources to the project and references the stylesheet in the root layout file.
    -mcp, –use-devexpress-mcp
    Installs the DevExpress Documentation MCP Server for the generated solution. GitHub Copilot queries DevExpress documentation through this server to improve response accuracy and reduce model hallucinations. Refer to DevExpress Documentation MCP Server for setup details.

    Execution Parameters

    –dry-run
    Displays a summary of what would happen if you ran the given command.
    –force
    Forces content to be generated even if it would change existing files.
    –no-update-check
    Disables the check for template package updates when instantiating a template.

    Examples

    Create a basic Blazor application project named “MyBlazorServerApp”.

    dotnet new dx.blazor --name MyBlazorServerApp
    

    Create a Blazor application project with the OpenAI LLM service. Apply the DevExpress Fluent Light theme to the project.

    dotnet new dx.blazor --name MyBlazorServerApp --add-ai-resources OpenAI --theme FluentLight
    

    Create a .NET 10 Blazor application project with a PDF Viewer and Scheduler.

    dotnet new dx.blazor --name MyBlazorServerApp --framework net10.0 --add-views PdfViewer Scheduler