Repo sync for protected branch#11339
Merged
learn-build-service-prod[bot] merged 43 commits intoMay 12, 2026
Merged
Conversation
Add code examples, fix API names, fill empty sections, and improve Learn formatting for the MSBuild multithreaded task migration how-to. - Fix API names to match spec (IMultiThreadableTask, etc.) - Add BuildCommentTask as running before/after example - Document AbsolutePath type and API replacement table - Fill 'Apply the attribute' section with two-option guidance - Add CLI-only caveat, Roslyn analyzer tip, thread-safety warnings - Expand backward compatibility section with 3 options + comparison - Add article to TOC under Tasks - Update frontmatter for SEO Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add DISABLE_BUILD_COMMENTS env var check to the running example so the environment variables section uses a concrete before/after pattern from the same task instead of generic placeholders. - Insert env var check in both before and after full listings - Replace MY_VAR/BUILD_OUTPUT with DISABLE_BUILD_COMMENTS in section - Update issue count (3→4) and migration step count (4→5) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The static ModifiedFileCount with Interlocked.Increment is already thread-safe. Changing to an instance field would alter the behavior. Instead, keep the original pattern and add a note about limitations when multiple builds share the same process. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Change the original BuildCommentTask to use non-atomic ModifiedFileCount++ so the before/after contrast clearly illustrates the problem and fix: - Before: ModifiedFileCount++ (race condition) - After: Interlocked.Increment (atomic, thread-safe) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Present static field migration as a progression: 1. Naive ++ (race condition) 2. Interlocked.Increment (atomic, but shared across builds) 3. RegisterTaskObject with Build lifetime (correct per-build isolation) Explains that in multithreaded mode, multiple builds can share a process, so static fields leak across build invocations. Uses IBuildEngine4.RegisterTaskObject to scope shared state to one build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Static fields already persisted across builds with node reuse (the default) before multithreading was introduced. The article now explains both dimensions: persistence (old problem, made worse) and concurrency (new problem from multithreading). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Changed 'source files' to 'text files' and explained that CommentPrefix/CommentSuffix adapt the comment syntax to the file type. Added MSBuild project file snippet showing usage with @(Compile) and @(Content) item groups. Added code comments to all listings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The normal case for BuildCommentTask is generated or auxiliary text files, not source files. Default to plain text with no comment prefix; callers provide CommentPrefix/CommentSuffix when targeting files with comment syntax (C#, XML, Python, etc.). Updated all three code listings and MSBuild usage snippet. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The multithreaded task execution model requires MSBuild 18.4, not 18.0 as previously stated. Updated all references throughout the article. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- update-task-multithreaded.md: Added -mt mention in intro paragraph and expanded Prerequisites with dotnet build -mt example and link - msbuild-command-line-reference.md: Duplicated switches table into vs-2022 and visualstudio moniker blocks; added -multiThreaded/-mt entry to the visualstudio table only Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Callers are responsible for passing only text files and setting the appropriate CommentPrefix/CommentSuffix for the file type. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
New subsection under 'Update paths and file I/O' covering: - Why file contention occurs in multithreaded mode - FileStream with explicit locking (FileShare.None) - Guidelines: retry on IOException, avoid multi-file locks, lock in consistent order, keep locks short Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Point readers to FileStream, FileShare, and managed threading best practices docs for general guidance beyond the MSBuild example. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Downgraded from WARNING to NOTE, explained that this only applies to tasks that spawn their own threads (Parallel.ForEach, Task.Run), not to normal tasks that let MSBuild handle parallelism. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…into task-multithreaded-updates
Co-authored-by: AR-May <67507805+AR-May@users.noreply.github.com>
… into task-multithreaded-updates
Co-authored-by: Rainer Sigwald <raines@microsoft.com>
… into task-multithreaded-updates
Add how to article for updating tasks
Acrolinx fix: Corrected spelling of 'hierarchal' to 'hierarchical' in the documentation.
Feature 573313: Q&M: Screenshot updates for Visual Studio 2026 (Set 4)
Auto Publish – main to live - 2026-05-12 22:00 UTC
Contributor
Author
|
Learn Build status updates of commit 3638fe6: ✅ Validation status: passedFor more details, please refer to the build report. |
Contributor
PRMerger Results
|
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.
Learn Build Service tried pushing to main, but failed due to branch protection rule in this branch. We create this pull request for manual merge. Please merge this pull request to complete this sync.
If you want to make push successfully without creating such pull requests in future, please follow working with branch protection rule to update your branch protection rule.