Skip to content

Conversation

@jonathanpeppers
Copy link
Member

Context: dotnet/android#10631

Add support for calling the DeployToDevice MSBuild target during dotnet run. The target is invoked after the build step (or with --no-build) to enable deployment to physical devices or emulators.

  • Create RunCommandSelector once per run for framework/device selection and deployment

  • Call DeployToDevice target if it exists in the project

  • Reuse cached ProjectInstance for performance

  • Add localized message for deployment failures

  • Added tests

Context: dotnet/android#10631

Add support for calling the `DeployToDevice` MSBuild target during
`dotnet run`. The target is invoked after the build step (or with
--no-build) to enable deployment to physical devices or emulators.

- Create `RunCommandSelector` once per run for framework/device
  selection and deployment

- Call `DeployToDevice` target if it exists in the project

- Reuse cached `ProjectInstance` for performance

- Add localized message for deployment failures

- Added tests
@jonathanpeppers jonathanpeppers force-pushed the dev/peppers/DeployToDevice branch from b05d995 to 09f9f0d Compare December 9, 2025 20:15
jonathanpeppers added a commit to dotnet/android that referenced this pull request Dec 9, 2025
Context: dotnet/sdk#52046
Context: https://github.com/dotnet/sdk/blob/c164a9bc1246c48191fb780992530f0fe975141b/documentation/specs/dotnet-run-for-maui.md

When the `DeployToDevice` target is run by the `dotnet run` pipeline,
we will no longer need to make the `ComputeRunArguments` target deploy
anything.

We are thinking this feature can ship in future .NET 11 and 10.0.200
SDKs.
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.

2 participants