Aspire configuration: support a default NuGet source
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
Aspire package and template operations need a durable way to use a custom NuGet source.
This blocks workflows in enterprise environments where direct access to NuGet.org is prohibited and package traffic must use an approved internal proxy. An explicit `--source` works for individual CLI commands (with #19351 also ensuring it is honored during template discovery), but users currently need to provide it on every invocation.
This also affects editor workflows. The VS Code extension delegates to the Aspire CLI, but has no way to provide a source for commands such as `aspire new` and `aspire add`. A VS Code-specific setting was proposed in #19347, but that would only fix one entry point rather than the underlying CLI behavior.
### Describe the solution you'd like
Add a default NuGet source property to `aspire.config.json`, including the global user configuration.
For example (exact property name TBD):
```json
{
"nugetSource": "https://packagefeedproxy.microsoft.io/nuget/v3/index.json"
}
```
The configured source should:
- Be used by Aspire package and template operations that support a custom source.
- Apply consistently when commands are run directly from the CLI or through integrations such as the VS Code extension.
- Follow the existing Aspire configuration precedence rules.
- Be overridden by an explicit `--source` argument.
- Preserve the current behavior when it is not configured.
An environment variable was also considered, but there does not appear to be an existing NuGet convention to honor. A global Aspire configuration property gives users one persistent setting while still allowing more granular CLI overrides.
### Additional context
This was originally scoped as a VS Code extension setting. Based on the discussion in #19347, a CLI-owned configuration property is a better fit because it solves the same problem across terminals and editor integrations.
Related:
- #19347
- #19351
- #19338
Contributor guide
Research direction
Start by tracing how the Aspire CLI reads aspire.config.json and applies existing configuration precedence for package and template operations, including commands used by the VS Code extension. Define the default NuGet source property and verify that global configuration, explicit --source overrides, and the unconfigured behavior work consistently across the affected operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100