Skip to content

[release/10.0.1xx] [msbuild] Diagnose remote task requests without an application name - #27025

Merged
rolfbjarne merged 1 commit into
release/10.0.1xxfrom
dev/rolf/backport-pr-26906-release/10.0.1xx-2026-10-26
Oct 27, 2026
Merged

rolfbjarne merged 1 commit into
release/10.0.1xxfrom
dev/rolf/backport-pr-26906-release/10.0.1xx-2026-10-26

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Remote tasks can lose their application association after the remote build session disconnects. In that case, ExecuteTaskMessageHandler currently fails in Path.Combine with an opaque ArgumentNullException naming path2.

Validate a null AppName before accessing the build directory or invoking the task runner. The localized diagnostic names the task and build session, identifies the missing application name, and explains that the task must run while its remote build session is connected.

Add regression coverage for the missing-name diagnostic and for valid requests, including input/result forwarding and working-directory restoration. Reference the messaging agent's built assembly during normal test builds to avoid duplicate types from the ILMerged task dependencies, and use a project reference for design-time resolution.

Related to #26847. This improves error reporting only; the task ordering and application-association fixes are separate.

Note

🤖 Pull request created by Copilot


Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com

Backport of #26906.

Reject ExecuteTaskMessage requests with a null AppName before accessing the build directory or invoking the task runner. Report the missing application association with a localized diagnostic that identifies the task and build session and explains that the task must run while its remote build session is connected.

Add handler regression tests for the missing-name diagnostic and the valid request path, including input/result forwarding and working-directory restoration. Build and reference the messaging agent alongside the existing ILMerged task assembly so its package dependencies do not introduce duplicate types into the test project.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@rolfbjarne rolfbjarne added backported ready-to-review This PR is ready to review/merge. labels Oct 26, 2026
Copilot AI balanced review requested due to automatic review settings October 26, 2026 16:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The missing design-time project reference leaves editor resolution dependent on a previously built, potentially stale messaging-agent assembly.

1 open issue
1 file not reviewed
  • msbuild/Messaging/Xamarin.Messaging.Build/Properties/Resources.Designer.cs: Generated file
What changed in this PR

This backport improves remote MSBuild diagnostics when a task request has no application name. It replaces the opaque path error with actionable session details; task ordering and application association remain outside its scope.

Changes:

  • Reject null application names before accessing the build directory or invoking the task runner.
  • Add a localized diagnostic identifying the task and build session.
  • Add regression tests and messaging-agent build references.
File Description
tests/​msbuild/​Xamarin.MacDev.Tasks.Tests/​Xamarin.MacDev.Tasks.Tests.csproj Builds and references the messaging agent for tests.
tests/​msbuild/​Xamarin.MacDev.Tasks.Tests/​ExecuteTaskMessageHandlerTests.cs Tests missing-name diagnostics, forwarding, and directory restoration.
msbuild/​Messaging/​Xamarin.Messaging.Build/​Properties/​Resources.resx Adds the actionable missing-name diagnostic.
msbuild/​Messaging/​Xamarin.Messaging.Build/​Properties/​Resources.Designer.cs Exposes the new resource string.
msbuild/​Messaging/​Xamarin.Messaging.Build/​Handlers/​ExecuteTaskMessageHandler.cs Validates the application name before task execution.

Review effort: Balanced

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 6bd8627170e11a9f14c4877ed3a46e048d3f1fc3 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #6bd8627] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 200 tests passed 🎉

Tests counts

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 19 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 19 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Golden Gate (27): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

✅ Linux build succeeded

Pipeline on Agent
Hash: 6bd8627170e11a9f14c4877ed3a46e048d3f1fc3 [PR build]

@rolfbjarne
rolfbjarne merged commit 0e5a381 into release/10.0.1xx Oct 27, 2026
56 checks passed
@rolfbjarne
rolfbjarne deleted the dev/rolf/backport-pr-26906-release/10.0.1xx-2026-10-26 branch October 27, 2026 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backported ready-to-review This PR is ready to review/merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants