Repository navigation
Migrate CreateWixCommandPackageDropBase to multithreaded MSBuild - #17522
Conversation
…Drop Closes the last multithreading hole in this assembly. CreateLightCommandPackageDrop was previously left un-attributed because nearly all of its execution lives in the abstract base, which passed raw paths to File/Directory APIs. The base was also invisible to the analyzer, since the path rules are scoped to types carrying [MSBuildMultiThreadableTask] or implementing IMultiThreadableTask, and the base did neither. Only the derived class's own File.Copy was checked. - Hoist TaskEnvironment onto CreateWixCommandPackageDropBase and have it implement IMultiThreadableTask, which brings its members under analyzer coverage. - Resolve packageDropOutputFolder once at the entry of ProcessWixCommand and thread the AbsolutePath through the private helpers. - Resolve the AdditionalBasePaths probe in ProcessXPath. Paths read out of the wixobj XML keep their original form when reported, because oldPath is only reassigned once a candidate is found. - Keep the OutputFile [Output] property in the form the project supplied through OutputFolder; only the copy used for file I/O is resolved. - Mark CreateLightCommandPackageDrop with [MSBuildMultiThreadableTask] and drop its local TaskEnvironment, which the base now provides. The generated create.cmd embeds only file names, and zip entry names are relative to the source directory, so the produced wixpack is unchanged. Co-authored-by: Copilot <[email protected]> Copilot-Session: be19d794-fe4f-43fe-9e6e-f6e6b13ec6e7
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The path-resolution changes consistently follow existing repo patterns for multithreaded MSBuild tasks, and the remaining feedback is a non-blocking maintainability improvement.
Review tier: Lite
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.Build.Tasks.Installers/src/CreateWixCommandPackageDropBase.cs — ProcessToolSpecificCommandLineParameters still uses a string parameter, but the base now flows an… |
What changed in this PR
Migrates CreateWixCommandPackageDropBase (and thus CreateLightCommandPackageDrop) to be safe under multithreaded MSBuild execution by ensuring all filesystem I/O uses TaskEnvironment-resolved paths and by opting the task into the multithreadable task host.
Changes:
- Implement
IMultiThreadableTaskonCreateWixCommandPackageDropBaseand addTaskEnvironmentfor project-relative path resolution. - Resolve key inputs/outputs (
packageDropOutputFolder,OutputFolder/OutputFile, wix/loc inputs, andAdditionalBasePathsprobes) toAbsolutePathbefore file/directory operations. - Mark
CreateLightCommandPackageDropwith[MSBuildMultiThreadableTask]and remove its redundant localTaskEnvironmentimplementation.
| File | Description |
|---|---|
| src/Microsoft.DotNet.Build.Tasks.Installers/src/CreateWixCommandPackageDropBase.cs | Hoists TaskEnvironment and threads AbsolutePath through helpers so all file I/O is analyzer-covered and project-relative under multithreaded MSBuild. |
| src/Microsoft.DotNet.Build.Tasks.Installers/src/CreateLightCommandPackageDrop.cs | Opts the task into multithreaded execution and relies on the base for TaskEnvironment. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Preserves the type signal end-to-end instead of relying on an implicit conversion at the override boundary. Co-authored-by: Copilot <[email protected]> Copilot-Session: be19d794-fe4f-43fe-9e6e-f6e6b13ec6e7
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
It introduces a breaking change by modifying a protected abstract method signature on a public, packable task base type, which can break external derived-task consumers.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 1
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.Build.Tasks.Installers/src/CreateWixCommandPackageDropBase.cs — Changing the protected abstract method signature from string to AbsolutePath is a breaking… |
|
src/Microsoft.DotNet.Build.Tasks.Installers/src/CreateLightCommandPackageDrop.cs — If the base restores the original ProcessToolSpecificCommandLineParameters(string, ...) for API… |
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.Build.Tasks.Installers/src/CreateWixCommandPackageDropBase.cs — ProcessToolSpecificCommandLineParameters still uses a string parameter, but the base now flows an… View resolved comment |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused migration consistently resolves file-system paths without changing generated package semantics.
Review tier: Balanced
Findings: None
Issues resolved since last review (2)
| Severity | Finding |
|---|---|
src/Microsoft.DotNet.Build.Tasks.Installers/src/CreateLightCommandPackageDrop.cs — If the base restores the original ProcessToolSpecificCommandLineParameters(string, ...) for API… View resolved comment |
|
src/Microsoft.DotNet.Build.Tasks.Installers/src/CreateWixCommandPackageDropBase.cs — Changing the protected abstract method signature from string to AbsolutePath is a breaking… View resolved comment |


Follow-up to #17513, which migrated the rest of
Microsoft.DotNet.Build.Tasks.Installersbut leftCreateLightCommandPackageDropopted out.That exclusion was structural rather than intrinsic. Nearly all of the task's execution lives in its abstract base,
CreateWixCommandPackageDropBase, which passed raw paths toFile/DirectoryAPIs. The base was also invisible to the analyzer: the path rules are scoped to types carrying[MSBuildMultiThreadableTask]or implementingIMultiThreadableTask, and the base did neither, so only the derived class's ownFile.Copywas ever checked. The base lives in this same assembly and has exactly one derived class, so it can simply be migrated.TaskEnvironmentontoCreateWixCommandPackageDropBaseand have it implementIMultiThreadableTask, which brings its members under analyzer coverage.packageDropOutputFolderonce at the entry ofProcessWixCommandand thread theAbsolutePaththrough the private helpers.AdditionalBasePathsprobe inProcessXPath. Paths read out of the wixobj XML keep their original form when reported, becauseoldPathis only reassigned once a candidate is found.OutputFile[Output]property in the form the project supplied throughOutputFolder; only the copy used for file I/O is resolved.CreateLightCommandPackageDropwith[MSBuildMultiThreadableTask]and drop its localTaskEnvironment, which the base now provides.The produced wixpack is unchanged: the generated
create.cmdembeds only file names, and zip entry names are relative to the source directory.Validation
Builds with 0 warnings. Verified the base class is genuinely under analyzer coverage now, rather than just re-annotated, by temporarily reverting one call site in
CreateWixCommandPackageDropBaseand confirming it fails withMSBuildTask0003— onmainthat same revert produces no diagnostic at all.