Skip to content

Conversation

@jonathanpeppers
Copy link
Member

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.

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.

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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants