Repository navigation
Migrate ShowPreviewMessage to IMultiThreadableTask - #53956
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates ShowPreviewMessage to participate in MSBuild’s multithreaded task execution model by marking it as multithreadable and implementing IMultiThreadableTask, with accompanying unit tests validating expected behavior.
Changes:
- Adds
[MSBuildMultiThreadableTask]and implementsIMultiThreadableTaskonShowPreviewMessage, including aTaskEnvironmentproperty. - Introduces new unit tests covering interface implementation, guard/registration behavior, logging behavior, and per-engine isolation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Tasks/Microsoft.NET.Build.Tasks/ShowPreviewMessage.cs |
Marks the task as multithreadable and adds the IMultiThreadableTask TaskEnvironment property (with NETFRAMEWORK handling). |
src/Tasks/Microsoft.NET.Build.Tasks.UnitTests/GivenAShowPreviewMessageMultiThreading.cs |
Adds unit tests validating multithreadable task requirements and expected logging/guard behavior. |
This was referenced Apr 17, 2026
SimaTian
marked this pull request as draft
April 28, 2026 08:16
SimaTian
force-pushed
the
migrate-show-preview-message
branch
from
April 29, 2026 12:10
a180d93 to
5be750f
Compare
OvesN
marked this pull request as ready for review
May 5, 2026 09:35
OvesN
approved these changes
May 5, 2026
AR-May
approved these changes
May 5, 2026
AR-May
reviewed
May 5, 2026
AR-May
approved these changes
May 5, 2026
- Add [MSBuildMultiThreadableTask] attribute to support multi-threaded execution - Implement IMultiThreadableTask interface with TaskEnvironment property - Conditional implementation for NETFRAMEWORK vs other targets - Add comprehensive unit tests for multi-threading scenarios Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SimaTian
force-pushed
the
migrate-show-preview-message
branch
from
May 13, 2026 10:24
f3ea3ae to
4dd95b7
Compare
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.
Context
The
ShowPreviewMessagetask was migrated to support multithreaded executionunder MSBuild's
IMultiThreadableTaskmodel.Changes Made
ShowPreviewMessage.cs
multiple task instances:
GetRegisteredTaskObjectcheck before taking any lock.GetRegisteredTaskObjectcall so the message is logged and the markerobject is registered exactly once per build, even when several
ShowPreviewMessageinstances run in parallel.Supersedes
Part of the split of stuck merge-group PR #52936. This is the 5-of-5 split for \ShowPreviewMessage.