microsoft / microsoft/aspire

Use new 'dotnet run' 9.1 options for launching projects

Open
#7,112 7 comments 1 reaction 0 assignees View on GitHub
area-app-model
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.

In .NET 9.1 `dotnet run` gains two new launch options that would be useful for launching projects in the context of an Aspire app:

1. `-e` causes an environment variable to be applied to the application being launched, but NOT to the targets participating in the application build (unlike the old `env:` option).

2. `--no-launch-profile-arguments` allows to ignore invocation arguments in launch profiles

See https://github.com/dotnet/sdk/pull/45844 for an example how these options are used in the context of `dotnet watch`

### Describe the solution you'd like

Ideally these options would be used to launch projects when Aspire app host is launched from command line via `dotnet run`. The problem is they are only available in .NET 9.1 and newer. So either Aspire app host needs to somehow learn what `dotnet` CLI version is available and change the launch options used accordingly, or start using these new launch options only after .NET 9.1 or later becomes a required dependency for Aspire.

### Additional context

@DamianEdwards FYI

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.