Backport PR #11951: Add noProfileSwitch to run command in DotNetCliRunner#11959
Merged
joperezr merged 2 commits intorelease/9.5from Oct 17, 2025
Merged
Backport PR #11951: Add noProfileSwitch to run command in DotNetCliRunner#11959joperezr merged 2 commits intorelease/9.5from
joperezr merged 2 commits intorelease/9.5from
Conversation
…nd and filter empty arguments Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Backport pull request #11951 for dotnet/aspire
Backport PR #11951: Add noProfileSwitch to run command in DotNetCliRunner
Oct 11, 2025
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11959Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11959" |
1 similar comment
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 11959Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 11959" |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR backports changes from #11951 to improve the consistency of the dotnet run command behavior between single-file and multi-file AppHost projects in the Aspire CLI.
- Updated single-file project run command to include the
noProfileSwitchparameter and use--fileflag instead of positional argument - Added argument filtering to remove empty or whitespace-only arguments from the CLI command array
- Enhanced test coverage with three new test methods to validate the changes
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Cli/DotNet/DotNetCliRunner.cs | Updated single-file project run command construction and added empty argument filtering |
| tests/Aspire.Cli.Tests/DotNet/DotNetCliRunnerTests.cs | Added feature enablement to existing test and three new test methods for single-file AppHost scenarios |
JamesNK
approved these changes
Oct 14, 2025
joperezr
approved these changes
Oct 17, 2025
Contributor
|
"🚀 Dogfood this PR with:" What is Dogfood? |
This was referenced Oct 23, 2025
This was referenced Nov 17, 2025
Closed
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR backports the changes from #11951 to ensure consistent behavior between single-file and multi-file AppHost project runs in the Aspire CLI.
Changes
DotNetCliRunner.cs
noProfileSwitchargument, aligning behavior with multi-file projects--fileflag for single-file projectsdotnet runBefore:
After:
And added:
DotNetCliRunnerTests.cs
AddPackageAsyncUseFilesSwitchForSingleFileAppHosttest to enable theSingleFileAppHostEnabledfeatureRunAsyncAppliesNoLaunchProfileForSingleFileAppHost- Validates that--no-launch-profileis included when specifiedRunAsyncDoesNotIncludeNoLaunchProfileForSingleFileAppHostWhenNotSpecified- Validates the flag is omitted when not specifiedRunAsyncFiltersOutEmptyArgumentsForSingleFileAppHost- Validates that empty arguments are properly filtered outTesting
All 386 CLI tests pass successfully with these changes, confirming no regressions were introduced.
Note
The original PR #11951 included additional tests that depend on features (
Debugproperty,nonInteractiveSwitch, andverboseSwitch) not present in the target branch. This backport includes only the compatible changes while maintaining the core functionality improvements.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.