Skip to content

Use new 'dotnet run' 9.1 options for launching projects #7112

@karolz-ms

Description

@karolz-ms

Is there an existing issue for this?

  • 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 dotnet/sdk#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions