Skip to content

[release/11.0.2xx] Identify failing target framework in dotnet test device-selection errors - #56674

Merged
jonathanpeppers merged 1 commit into
release/11.0.2xxfrom
backport/pr-56659-to-release/11.0.2xx
Oct 16, 2026
Merged

jonathanpeppers merged 1 commit into
release/11.0.2xxfrom
backport/pr-56659-to-release/11.0.2xx

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Backport of #56659 to release/11.0.2xx

/cc @jonathanpeppers

…rrors (#56659)

## Summary

Improve `dotnet test` device-selection failures to identify the project and target framework that failed, while preserving the selector's original error. Do not change device selection or normal all-target-framework execution.

For example:

```text
No devices are available for this project.
Device selection failed for project 'MauiTestRc2.csproj' (target framework 'net11.0-ios').
```

Projects without a target framework receive a project-only diagnostic. Includes regression coverage, regenerated localization, and clarification of multi-target device behavior in the existing MAUI run/test specification.

## Problem

`SelectDeviceForTfm` reported every failed device selection as a multiple-devices error, even when no devices were available. In a project targeting Android, iOS, and Mac Catalyst, selecting an Android device could succeed and then device selection for iOS could fail. The resulting error incorrectly suggested the Android device selection was still ambiguous and did not identify the failing framework.

This was reproduced interactively with .NET 11 RC 2 on Windows: selecting Pixel 5 among four connected Android devices succeeded, then iOS discovery returned no devices because `IsMacEnabled` was false. Android-only execution, including plain `dotnet test` on a project with only the Android entry in `TargetFrameworks`, succeeded.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions
github-actions Bot requested review from a team as code owners October 16, 2026 18:15
@github-actions github-actions Bot added the backport PR that has been backported to a servicing branch label Oct 16, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@jonathanpeppers jonathanpeppers added backport PR that has been backported to a servicing branch and removed backport PR that has been backported to a servicing branch labels Oct 16, 2026
@jonathanpeppers
jonathanpeppers merged commit fe0ecd0 into release/11.0.2xx Oct 16, 2026
21 checks passed
@jonathanpeppers
jonathanpeppers deleted the backport/pr-56659-to-release/11.0.2xx branch October 16, 2026 21:12

This branch had an error being deployed

1 failed deployment
copilot-pat-pool — fcb1e0cb Deployed Oct 16, 2026 by jonathanpeppers via pre_activation #9395
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport PR that has been backported to a servicing branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant