Repository navigation
[release/10.0.1xx] [msbuild] Diagnose remote task requests without an application name - #27025
Conversation
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>
There was a problem hiding this comment.
🟡 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
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [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 macOS tests✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |

Remote tasks can lose their application association after the remote build session disconnects. In that case,
ExecuteTaskMessageHandlercurrently fails inPath.Combinewith an opaqueArgumentNullExceptionnamingpath2.Validate a null
AppNamebefore 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.