Skip to content

Conversation

@jonathanpeppers
Copy link
Member

Backport of: #51509

Implements the first part of the spec mentioned in:

* "Pre-run evaluation"
* If the project is multi-targeted, containing the
`$(TargetFrameworks)` property _and_ that property has more than
one item in it, and `-f` was not supplied...
* Prompt the user to select from a list of the
`$(TargetFrameworks)`
* Non-interactive mode will give a friendly error message,
suggesting to supply the `-f` property, listing available target
frameworks in the project.

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.

Other changes:

  • Pin darc to "1.1.0-beta.25514.2"

)

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.

Other changes:

* Pin `darc` to "1.1.0-beta.25514.2"

Co-authored-by: Chet Husk <[email protected]>
Co-authored-by: Premek Vysoky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants