Migrate xml tasks to TaskEnvironment API#13246
Merged
AR-May merged 6 commits intodotnet:mainfrom Feb 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates three XML-related tasks (XmlPeek, XmlPoke, and XslTransformation) to use the TaskEnvironment API for thread-safe execution in MSBuild's multithreaded builds. This migration enables these tasks to safely execute in parallel with other tasks within a single MSBuild process.
Changes:
- Added IMultiThreadableTask interface implementation and MSBuildMultiThreadableTask attribute to XmlPeek, XmlPoke, and XslTransformation tasks
- Modified all file path resolution to use TaskEnvironment.GetAbsolutePath() instead of directly using ITaskItem.ItemSpec
- Refactored internal helper classes (XmlInput, XsltInput) to work with AbsolutePath instead of raw strings
- Updated all unit tests to initialize TaskEnvironment using TaskEnvironmentHelper.CreateForTest()
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Tasks/XslTransformation.cs | Implemented IMultiThreadableTask, added TaskEnvironment property, converted XmlInput and XsltInput classes to use AbsolutePath, including compiled XSLT DLL path resolution |
| src/Tasks/XmlPoke.cs | Implemented IMultiThreadableTask, added TaskEnvironment property, converted file path resolution to use TaskEnvironment.GetAbsolutePath() |
| src/Tasks/XmlPeek.cs | Implemented IMultiThreadableTask, added TaskEnvironment property, refactored XmlInput class to use AbsolutePath |
| src/Tasks.UnitTests/XslTransformation_Tests.cs | Updated all test instantiations to initialize TaskEnvironment property using TaskEnvironmentHelper.CreateForTest() |
| src/Tasks.UnitTests/XmlPoke_Tests.cs | Updated all test instantiations to initialize TaskEnvironment property using TaskEnvironmentHelper.CreateForTest() |
| src/Tasks.UnitTests/XmlPeek_Tests.cs | Updated all test instantiations to initialize TaskEnvironment property using TaskEnvironmentHelper.CreateForTest() |
Co-authored-by: Jan Provazník <janpro@janpro.dev>
This reverts commit c4e3861.
AR-May
commented
Feb 13, 2026
AR-May
commented
Feb 13, 2026
JanProvaznik
approved these changes
Feb 17, 2026
This was referenced Feb 19, 2026
JanProvaznik
added a commit
to JanProvaznik/msbuild
that referenced
this pull request
Feb 25, 2026
### Context Migrating XmlPeek, XmlPoke and XslTransformation ### Testing Unit tests --------- Co-authored-by: Jan Provazník <janpro@janpro.dev>
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
Migrating XmlPeek, XmlPoke and XslTransformation
Testing
Unit tests