Update remote-host-object.md with SDK .tlb shipping and IDispatch example#13324
Merged
YuliiaKovalova merged 2 commits intomainfrom Mar 9, 2026
Merged
Conversation
…mple Document that Microsoft.Build.Framework.tlb ships with the .NET SDK starting from 10.0.3xx, explain why it is needed for the MSBuild apphost, and add a practical example of using IDispatch to communicate with a COM host object across process boundaries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the remote-host-object.md spec to document how MSBuild apphost enables COM marshaling for out-of-proc task hosts, including why the Microsoft.Build.Framework.tlb needs to ship with the .NET SDK and an IDispatch-based late-binding pattern for host-object interaction.
Changes:
- Document shipping
Microsoft.Build.Framework.tlbwith the .NET SDK (starting in 10.0.3xx) and explain why it’s required forITaskHostCOM marshaling in apphost scenarios. - Add an end-to-end
IDispatch/reflection example of calling a VS host object method (QueryAllTaskItems) from an out-of-proc task, with a fallback path. - Minor wording/link updates, including linking to the MSBuild apphost support issue.
Comments suppressed due to low confidence (1)
documentation/specs/remote-host-object.md:154
- The table’s Security row claims credentials are extracted from the JSON and stored in environment variables that are cleared in a
finallyblock, but neither the preceding host-side JSON example nor the task-side example shows that behavior (the JSON shown only includesUserName). This reads as a guarantee that isn’t supported by the documented example; please either remove this row or adjust it to describe the security properties actually demonstrated (or extend the example/text to match the real implementation).
| **Security** | Credentials extracted from the JSON are held in environment variables only for the duration of the task execution and cleared in a `finally` block. |
rainersigwald
approved these changes
Mar 9, 2026
Co-authored-by: Rainer Sigwald <raines@microsoft.com>
This was referenced Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update
remote-host-object.mdwith documentation for the MSBuild apphost changes.What's added
Shipping
Microsoft.Build.Framework.tlbwith the .NET SDK - documents that the.tlbships starting from 10.0.3xx, explains why it's needed (COM marshaling forITaskHostacross process boundaries), what capabilities it enables (ROT host objects, registration-free COM, parity with VS), and shows the SDK layout.Practical
IDispatchexample - end-to-end example showing how a VS host object (WebTools) serializes task items to JSON viaQueryAllTaskItems, and how the SDK Container task (dotnet/sdk#52856) calls it viaIDispatch(reflectionInvokeMember) with a fallback to the legacy in-proc path.Related PRs: