Is there an existing issue for this?
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):
{
"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:
Is there an existing issue for this?
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
--sourceworks 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 newandaspire 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):
{ "nugetSource": "https://packagefeedproxy.microsoft.io/nuget/v3/index.json" }The configured source should:
--sourceargument.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:
aspire new --sourcestill contacts NuGet.org during template discovery #19338