-
Couldn't load subscription status.
- Fork 1.2k
[dotnet-cli] prompt for target framework using Spectre.Console
#51430
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
Draft
jonathanpeppers
wants to merge
8
commits into
dotnet:main
Choose a base branch
from
jonathanpeppers:dev/peppers/tf-selection
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[dotnet-cli] prompt for target framework using Spectre.Console
#51430
jonathanpeppers
wants to merge
8
commits into
dotnet:main
from
jonathanpeppers:dev/peppers/tf-selection
Conversation
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
Implements the first part of the spec mentioned in: https://github.com/dotnet/sdk/blob/522c88a6abfc4a011556f839d15844d07ba62cd9/documentation/specs/dotnet-run-for-maui.md?plain=1#L35-L46 Add interactive target framework selection to `dotnet run` When running a multi-targeted project without specifying `--framework`, `dotnet run` now: * Prompts interactively (using `Spectre.Console`) to select a framework with arrow keys * Shows a formatted error list in non-interactive mode with available frameworks * Handles selection early before project build/evaluation * Removes redundant multi-TFM error checking from `ThrowUnableToRunError()` * Adds a few unit tests to validate these changes. This is currently WIP, as it introduces a "pre-built" `Spectre.Console` that I will need to setup in source-build in a PRs elsewhere.
baronfel
reviewed
Oct 23, 2025
So it doesn't require `mono`
This was referenced Oct 24, 2025
There are other tests that do this
This test fails after I made it check TF at runtime. This was not even the existing behavior, I think we can remove this test.
This was referenced Oct 27, 2025
jonathanpeppers
added a commit
to jonathanpeppers/spectre.console
that referenced
this pull request
Oct 29, 2025
Context: dotnet/sdk#51430 Context: dotnet/source-build-reference-packages#1447 We would like to use Spectre.Console for the `dotnet` CLI, and .NET has to be able to be completely built from source. It would help us to have `PolySharp` only included when building for `netstandard2.0`, as that is the only target framework that needs the polyfills. .NET would probably only use the latest target framework. Thanks!
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements the first part of the spec mentioned in:
sdk/documentation/specs/dotnet-run-for-maui.md
Lines 35 to 46 in 522c88a
Add interactive target framework selection to
dotnet runWhen running a multi-targeted project without specifying
--framework,dotnet runnow:Prompts interactively (using
Spectre.Console) to select a framework with arrow keysShows a formatted error list in non-interactive mode with available frameworks
Handles selection early before project build/evaluation
Removes redundant multi-TFM error checking from
ThrowUnableToRunError()Adds a few unit tests to validate these changes.
This is currently WIP, as it introduces a "pre-built"
Spectre.Consolethat I will need to setup in source-build in a PRs elsewhere.