Skip to content

Update remote-host-object.md with SDK .tlb shipping and IDispatch example#13324

Merged
YuliiaKovalova merged 2 commits intomainfrom
dev/ykovalova/update-remote-host-object-docs
Mar 9, 2026
Merged

Update remote-host-object.md with SDK .tlb shipping and IDispatch example#13324
YuliiaKovalova merged 2 commits intomainfrom
dev/ykovalova/update-remote-host-object-docs

Conversation

@YuliiaKovalova
Copy link
Member

@YuliiaKovalova YuliiaKovalova commented Mar 4, 2026

Update remote-host-object.md with documentation for the MSBuild apphost changes.

What's added

  1. Shipping Microsoft.Build.Framework.tlb with the .NET SDK - documents that the .tlb ships starting from 10.0.3xx, explains why it's needed (COM marshaling for ITaskHost across process boundaries), what capabilities it enables (ROT host objects, registration-free COM, parity with VS), and shows the SDK layout.

  2. Practical IDispatch example - end-to-end example showing how a VS host object (WebTools) serializes task items to JSON via QueryAllTaskItems, and how the SDK Container task (dotnet/sdk#52856) calls it via IDispatch (reflection InvokeMember) with a fallback to the legacy in-proc path.

Related PRs:

…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>
Copilot AI review requested due to automatic review settings March 4, 2026 09:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.tlb with the .NET SDK (starting in 10.0.3xx) and explain why it’s required for ITaskHost COM 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 finally block, but neither the preceding host-side JSON example nor the task-side example shows that behavior (the JSON shown only includes UserName). 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. |

Co-authored-by: Rainer Sigwald <raines@microsoft.com>
@YuliiaKovalova YuliiaKovalova enabled auto-merge (squash) March 9, 2026 13:30
@YuliiaKovalova YuliiaKovalova merged commit bf9f757 into main Mar 9, 2026
10 checks passed
@YuliiaKovalova YuliiaKovalova deleted the dev/ykovalova/update-remote-host-object-docs branch March 9, 2026 14:05
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.

3 participants