Skip to content

Mark VSTestLogsTask as MSBuild-multithreadable - #16790

Merged
Azat Mukhametshin (azat-msft) merged 1 commit into
microsoft:mainfrom
JanProvaznik:mt-vstestlogstask
Dec 3, 2026
Merged

Azat Mukhametshin (azat-msft) merged 1 commit into
microsoft:mainfrom
JanProvaznik:mt-vstestlogstask

Conversation

@JanProvaznik

@JanProvaznik Jan Provazník (JanProvaznik) commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Marks VSTestLogsTask with [MSBuildMultiThreadableTask] (using an internal Microsoft.Build.Framework.MSBuildMultiThreadableTaskAttribute polyfill for MBF 17.11.48) so it runs in-process under MSBuild -mt instead of routing to an out-of-proc TaskHost on every dotnet test.

The task only logs localized messages based on LogType and accesses no files, CWD, environment variables, or mutable static state. See Update a task for multithreaded mode.

Relates to dotnet/msbuild#15698. cc AR-May

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 26, 2026 18:07
@JanProvaznik

Copy link
Copy Markdown
Contributor Author

cc AR-May for review

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.

🟢 Approval recommended

There are no active review issues for the change enabling in-process VSTest logging during multithreaded builds.

No open issues 🎉

What changed in this PR

This PR opts VSTest’s MSBuild logging task into in-process execution during multithreaded builds (dotnet build -mt), while retaining the existing MSBuild dependency.

Changes:

  • Marks VSTestLogsTask with [MSBuildMultiThreadableTask].
  • Adds an internal attribute polyfill so newer MSBuild hosts can recognize the marker without requiring a dependency upgrade.
File Description
src/​Microsoft.TestPlatform.Build/​Tasks/​VSTestLogsTask.cs Adds the multithreadable-task marker.
src/​Microsoft.TestPlatform.Build/​MSBuildMultiThreadableTaskAttribute.cs Defines the internal compatibility attribute with class-only, non-inherited usage.

Review effort: Balanced

@azat-msft

Copy link
Copy Markdown
Member

/azp run

1 similar comment
@azat-msft

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@azat-msft

Copy link
Copy Markdown
Member

/azp run

@azat-msft
Azat Mukhametshin (azat-msft) merged commit 4269883 into microsoft:main Dec 3, 2026
26 checks passed
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