aspire new command
aspire new - Create a new Aspire project or solution.
Synopsis
Section titled “Synopsis”aspire new [command] [options]Description
Section titled “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.
Interactive prompts
Section titled “Interactive prompts”When running aspire new in interactive mode, the command asks one or more questions before generating the project. The available prompts depend on the template and options you provide.
Use *.dev.localhost URLs?
Section titled “Use *.dev.localhost URLs?”During project creation, you may be prompted:
Use *.dev.localhost URLs?
This prompt determines whether the generated launch profile configures your Aspire services to be accessible via *.dev.localhost wildcard subdomain URLs (for example, https://myservice.dev.localhost) instead of standard http://localhost with port numbers.
What are *.dev.localhost URLs?
Section titled “What are *.dev.localhost URLs?”*.dev.localhost is a wildcard subdomain pattern that resolves to your local machine (127.0.0.1 or ::1) in most modern browsers without additional DNS configuration. This resolution is a browser feature — non-browser HTTP clients (for example, curl, HttpClient, or other command-line tools) don’t automatically resolve *.dev.localhost subdomains and may require hosts file entries to reach them.
The Aspire developer certificate trusts *.dev.localhost subdomains, so browsers accept HTTPS connections to any subdomain when the certificate is trusted.
Yes — use *.dev.localhost URLs
Section titled “Yes — use *.dev.localhost URLs”Choosing Yes configures the generated project so that each service gets a unique subdomain URL such as https://myservice.dev.localhost. This option:
- Enables HTTPS for all services from the start, leveraging the Aspire developer certificate.
- Gives each service its own origin, which prevents cookie and authentication token collisions between services running on the same machine.
- More closely mirrors a production setup where services are hosted on separate domains or subdomains.
Prerequisite: The Aspire developer certificate must be trusted on your machine. If you haven’t already done so, run:
aspire certs trustNo — use standard localhost URLs (default)
Section titled “No — use standard localhost URLs (default)”Choosing No (the default) configures services with standard http://localhost:<port> addresses. This option requires no certificate setup and works in all browsers and tools without additional configuration.
Options
Section titled “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.
-
--channelChannel to use for templates (
stable,staging,daily). -
-?, -h, --helpPrints help and usage documentation for the available commands and options.
-
-l, --log-level <Critical|Debug|Error|Information|None|Trace|Warning>Set the minimum log level for console output. Use this option to increase diagnostics while troubleshooting or reduce output in scripted runs.
-
--non-interactiveRun the command in non-interactive mode, disabling all interactive prompts and spinners.
-
--nologoSuppress the startup banner and telemetry notice.
-
--bannerDisplay the animated Aspire CLI welcome banner.
-
--wait-for-debuggerWait for a debugger to attach before running a command.
Commands
Section titled “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-starter | Starter App (ASP.NET Core/Blazor) |
aspire-ts-cs-starter | Starter App (ASP.NET Core/React) |
aspire-py-starter | Starter App (FastAPI/React) |
aspire-ts-starter | Starter App (Express/React) |
aspire-empty | Empty (C# AppHost) |
aspire-ts-empty | Empty (TypeScript AppHost) |
Examples
Section titled “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 CLI aspire new aspire-starter -
Create an AppHost project named
aspireappfrom the 13.2.0 templates and place the output in a folder nameddev.Aspire CLI aspire new aspire-empty --version 13.2.0 --name aspireapp --output ./dev -
Create an Aspire starter app using templates from the
dailychannel to get the latest pre-release templates.Aspire CLI aspire new aspire-starter --channel daily