Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
karolz-ms opened this issue Jan 15, 2025 · 3 comments
Open
1 task done

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

karolz-ms opened this issue Jan 15, 2025 · 3 comments
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Milestone

Comments

@karolz-ms
Copy link
Member

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

@karolz-ms karolz-ms added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Jan 15, 2025
@DamianEdwards
Copy link
Member

So either Aspire app host needs to somehow learn what dotnet CLI version is available and change the launch options used accordingly

Hmm we should be able to test what version of the .NET CLI will be used before we dispatch the call to dotnet run, via a dotnet --version call or similar.

@karolz-ms just to clarify, when you say .NET 9.1, do you mean .NET SDK/CLI 9.0.200, or some other version?

@karolz-ms
Copy link
Member Author

Yes, sorry, 9.0.200 series

@DamianEdwards
Copy link
Member

Ideally we'd do feature detection instead of version detection, but I don't think we can get the output of dotnet run --help in a stable structured format today, right @baronfel?

@davidfowl davidfowl added this to the 9.1 milestone Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
Development

No branches or pull requests

3 participants