Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article applies to: ✔️ Aspire CLI 9.4.0 and later versions.
Name
aspire new - Create a new Aspire project or solution.
Synopsis
aspire new [command] [options]
Description
The aspire new command is the driver for creating Aspire projects, apps, or solutions, based on the Aspire templates. Each command specifies the template to use, and the options for the driver specify the options for the template.
This command defaults to interactive mode. When executed without any options, the command prompts you for the project template and version, name, and output folder. When the --name, --output, and --version options are provided, the command runs non-interactive and generates files based on the command template.
Options
The following options are available:
-n, --nameThe name of the project to create.
-o, --outputThe output path for the project.
-s, --sourceThe NuGet source to use for the project templates.
-v, --versionThe version of the project templates to use.
-
-?, -h, --helpPrints help and usage documentation for the available commands and options.
-
-d, --debugEnable debug logging to the console, which prints detailed information about what Aspire CLI is doing when a command is run.
-
--wait-for-debuggerWait for a debugger to attach before running a command.
Commands
Each command represents a template. Pass the --help parameter to the template command to print the options available to the template.
| Command | Template |
|---|---|
aspire |
Aspire Empty App |
aspire-apphost |
Aspire AppHost |
aspire-mstest |
Aspire Test Project (MSTest) |
aspire-nunit |
Aspire Test Project (NUnit) |
aspire-servicedefaults |
Aspire Service Defaults |
aspire-starter |
Aspire Starter App |
aspire-xunit |
Aspire Test Project (xUnit) |
Examples
Create an Aspire solution from the template. Because the template was selected (
aspire-starter), you're prompted for the name, output folder, and template version.aspire new aspire-starterCreate an AppHost project named
aspireappfrom the 9.4.0 templates and place the output in a folder namedaspire1.aspire new aspire-apphost --version 9.4.0 --name aspireapp1 --output ./aspire1