Skip to content

Document that public Microsoft.Build.Tasks.CallTarget is not the live implementation#13670

Open
jankratochvilcz wants to merge 4 commits intomainfrom
jankratochvilcz/calltarget-tasks-comment
Open

Document that public Microsoft.Build.Tasks.CallTarget is not the live implementation#13670
jankratochvilcz wants to merge 4 commits intomainfrom
jankratochvilcz/calltarget-tasks-comment

Conversation

@jankratochvilcz
Copy link
Copy Markdown
Contributor

Per @rainersigwald's comment on #13616: the public Microsoft.Build.Tasks.CallTarget class is not the implementation that actually runs at build time — the MSBuild engine resolves <CallTarget> to the intrinsic implementation in Microsoft.Build.BackEnd.IntrinsicTasks.CallTarget (which is already enlightened for multithreaded mode). This type is retained only in case some third-party task derives from it.

This PR adds a <remarks> note to that effect on the public class so future readers/contributors don't try to enlighten or otherwise modify this dead-code path.

No behavioral change.

…entation

The MSBuild engine resolves CallTarget to the intrinsic implementation in Microsoft.Build.BackEnd.IntrinsicTasks.CallTarget. The public Microsoft.Build.Tasks.CallTarget type is retained only for backwards compatibility in case a third-party task derives from it. Add a remarks note so future readers and contributors don't try to enlighten or otherwise modify this dead-code path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 1, 2026 08:58
Copy link
Copy Markdown
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

Adds documentation clarifying that the public Microsoft.Build.Tasks.CallTarget type is retained for compatibility and is not the intrinsic implementation used when MSBuild executes the <CallTarget> element.

Changes:

  • Adds a <remarks> note to Microsoft.Build.Tasks.CallTarget explaining that MSBuild uses an intrinsic CallTarget implementation at build time.
  • Documents that the public type exists primarily for backward compatibility (e.g., third-party derivation).

Comment thread src/Tasks/CallTarget.cs Outdated
///
/// NOTE: This class is not the implementation that actually runs at build time. The MSBuild engine
/// resolves &lt;CallTarget&gt; to the intrinsic implementation in
/// Microsoft.Build.BackEnd.IntrinsicTasks.CallTarget. This type is retained only for backwards
Copy link

Copilot AI May 1, 2026

Choose a reason for hiding this comment

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

The remarks reference Microsoft.Build.BackEnd.IntrinsicTasks.CallTarget, but the intrinsic implementation currently lives in src/Build/BackEnd/Components/RequestBuilder/IntrinsicTasks/CallTarget.cs under namespace Microsoft.Build.BackEnd (type Microsoft.Build.BackEnd.CallTarget). As written, the doc points readers to a non-existent type/namespace; please update the fully qualified type name (and consider using <c>...</c> or a <see cref> if it won’t break doc generation).

Suggested change
/// Microsoft.Build.BackEnd.IntrinsicTasks.CallTarget. This type is retained only for backwards
/// <c>Microsoft.Build.BackEnd.CallTarget</c>. This type is retained only for backwards

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Review Summary

Documentation-only change — no behavioral or breaking-change concerns. The intent is correct and valuable: future contributors should know that Microsoft.Build.Tasks.CallTarget is dead code retained only for third-party derivation.

Issue found

Incorrect namespace in the comment. The comment references Microsoft.Build.BackEnd.IntrinsicTasks.CallTarget, but the actual fully-qualified name of the intrinsic implementation is Microsoft.Build.BackEnd.CallTarget. "IntrinsicTasks" is the folder path, not the namespace. See inline comment for details and a suggested fix.

Verification

I confirmed the claim is otherwise accurate by inspecting:

  • TaskExecutionHost.cs:971 — the engine explicitly redirects Microsoft.Build.Tasks.CallTarget → the intrinsic CallTarget type via IntrinsicTaskFactory.
  • src/Build/BackEnd/Components/RequestBuilder/IntrinsicTasks/CallTarget.cs:13 — namespace is Microsoft.Build.BackEnd, and the file already has a comment noting it replaces the Tasks version.

Generated by Expert Code Review (on open) for issue #13670 · ● 1.4M

Comment thread src/Tasks/CallTarget.cs Outdated
…ntrinsicTasks)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jankratochvilcz
Copy link
Copy Markdown
Contributor Author

Both reviewers correctly caught that the namespace I gave was wrong — the intrinsic implementation lives in Microsoft.Build.BackEnd (the IntrinsicTasks segment is the folder path, not the namespace). Fixed in 2ff1470 by referencing Microsoft.Build.BackEnd.CallTarget and including the source path for navigability.

I didn't go with <see cref="BackEnd.CallTarget"/> because the intrinsic type is internal to Microsoft.Build and the docs live in Microsoft.Build.Tasks, so the cref wouldn't resolve.

Comment thread src/Tasks/CallTarget.cs Outdated
Co-authored-by: Rainer Sigwald <rsigwald@gmail.com>
Comment thread src/Tasks/CallTarget.cs Outdated
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