Repository navigation
[WiX 5] Migrate workloads - #5265
Merged
Merged
Conversation
Member
Author
|
I have an unofficial VMR build that's green for the verticals. I'm going to remove the runtime copy of the workloads project next. |
Member
Author
|
I have a successful, fully signed build. Verified random nupkgs for the MSIs and the MSIs themselves
|
NikolaMilosavljevic
left a comment
Contributor
There was a problem hiding this comment.
A couple of design/maintainability items on the new WixDocument API (inline). Both are non-blocking but worth addressing since WixDocument is the central authoring surface of this redesign.
NikolaMilosavljevic
approved these changes
Jun 23, 2026
NikolaMilosavljevic
approved these changes
Jun 24, 2026
JeremyKuhne
approved these changes
Jun 24, 2026
This was referenced Jun 25, 2026
rmarinho
added a commit
to dotnet/maui
that referenced
this pull request
Jul 2, 2026
- docs/design/WorkloadMsi.md: Full architecture docs covering WiX 6 migration, validation criteria, package management, troubleshooting - .github/instructions/workload-msi.instructions.md: Copilot guidance for working with src/Workload/ files Documents lessons learned from the WiX 3→6 migration including: - NU1212 fix (netstandard2.0 + ExcludeAssets) - Arcade version requirements (26330.112+) - Extension path pattern (wixext6 subfolder) - SWIX build considerations - Validation criteria (Wix4DependencyProvider table, msi.json, VSDrop) - Comparison with dotnet/dotnet#5265 arcade-level rewrite Co-authored-by: Copilot App <[email protected]>
rmarinho
added a commit
to dotnet/maui
that referenced
this pull request
Jul 7, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Migrate workload MSI generation from WiX 3 (candle/light via `Microsoft.Signed.WiX`) to WiX 6 (wix.exe via `Microsoft.Wix` + extension packages). Follows the pattern established in dotnet/android#11743 and the yaml-templates `convert-v5/convert.proj` reference implementation. ## Related PRs - dotnet/android#11743 — Android WiX 6 migration (reference implementation) - dotnet/dotnet#5265 — Arcade-level WiX 5/6 rewrite (deeper refactor of `CreateVisualStudioWorkload` task internals) ## Changes ### `src/Workload/workloads.csproj` - Target framework changed to `netstandard2.0` (avoids NU1212 — `Microsoft.Wix` is a DotnetTool package type) - Added `GenerateDependencyFile=false` - Replaced `Microsoft.Signed.WiX` with WiX 6 packages (`Microsoft.Wix`, `Microsoft.WixToolset.Heat`, and 3 wixext packages) - `ExcludeAssets="all"` on `Microsoft.Wix` (required for DotnetTool package type) - Added `WixExe`, `HeatExe` properties and `WixExtensions` items - Updated `CreateVisualStudioWorkload` task invocation: `WixToolsetPath` → `WixExe`/`HeatExe`/`WixExtensions` - Removed `UseWorkloadPackGroupsForVS` (no longer supported in arcade 11.x) ### `eng/Versions.props` - Bumped arcade task packages to `11.0.0-beta.26330.112` (required for WiX 6 task parameters) - Added `MicrosoftWixVersion` = `6.0.3-dotnet.4` ### `eng/NuGetVersions.targets` - Replaced `Microsoft.Signed.WiX` version pin with 5 WiX 6 package pins ### `eng/pipelines/common/sdk-insertion.yml` - Removed outdated `v4.yml` comment ## Validation ✅ **Internal CI build [#3013410](https://dev.azure.com/dnceng/internal/_build/results?buildId=3013410) — PASSED** ### Artifact validation (matches dotnet/android#11743 acceptance criteria): 1. **MSI table rename** ✅ — Built with `WiX Dev Build (6.0.3.4)`, uses `Wix4DependencyProvider` table 2. **msi.json in MSI nupkg** ✅ — `ProviderKeyName` correctly populated (e.g., `"Microsoft.Maui.Core,11.0.0-preview.7.26352.12,x64"`) 3. **RelatedProducts** ✅ — `WIX_UPGRADE_DETECTED` / `WIX_DOWNGRADE_DETECTED` entries present (WiX 6 feature gain) 4. **VSDrop SWIX JSON** ✅ — All 3 VSDrop zips produced (components, components-pre, packs), vsman files correctly reference MSI packages with proper providerKey and install sizes ## Comparison with dotnet/dotnet#5265 (Arcade-level Rewrite) The arcade PR (dotnet/dotnet#5265) performs a deeper refactor of the WiX infrastructure. Here is how our approach compares: | Aspect | MAUI (this PR) | SDK (dotnet/dotnet#5265) | Status | |--------|----------------|--------------------------|--------| | WiX packages | ✅ Same 5 packages | Same | Aligned | | `WixExe`/`HeatExe`/`WixExtensions` | ✅ Correct | Same | Aligned | | Arcade version | 26330.112 | Same+ | Aligned | | SwixBuild package | `.Dotnet` 1.1.87 | Full variant 1.1.922 + desktop MSBuild | **Diverges** — works today | | SWIX build method | `<MSBuild>` task | `<Exec>` with desktop `msbuild.exe` | **Diverges** — works today | | `CreateWixPacks` | Not explicitly set (defaults to true) | Explicitly set | Functionally equivalent | | `LightCommandPackageDrop` | Never had it | Removed | N/A | ### Future considerations 1. **SwixBuild.Dotnet deprecation**: If `MicroBuild.Plugins.SwixBuild.Dotnet` is deprecated, we will need to switch to the full `Microsoft.VisualStudioEng.MicroBuild.Plugins.SwixBuild` + desktop MSBuild pattern (using `vswhere` to locate VS). 2. **Arcade dependency flow**: When the arcade version from dotnet/dotnet#5265 ships, improvements to `CreateVisualStudioWorkload` will flow to us automatically — no code changes needed in MAUI unless the task API changes. --------- Co-authored-by: Copilot App <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: rmarinho <[email protected]>
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.


Overview
This PR updates the various tasks used for generating workload MSIs, migrating from WiX v3 to v5. While publicly very little has changed, the internal organization is a near complete redesign and will make it easier to adapt to future changes in WiX.
MSI Source Templates
The previous implementation carried multiple source templates to build different installers for manifests, various workload pack types, pack groups and workload sets. The templates relied on a combination of extensive preprocessor logic and in a few cases, rewriting the XML from the existing templates, rendering the templates almost obsolete. The preprocessor directives also complicate generating wixpack archives needed for signing in v5.
The new implementation uses a single WiX source template, allowing derived classes to manipulate the source programmatically and follow a compositional pattern. The implementation is primarily confined to the
WixDocumentand various extension methods. Specialized classes used to generate specific workload MSIs can easily modify elements in the source.The new workflow is as follows
MsiBaseclass is responsible for extracting the default source template,Product.wxs.Test Coverage
Compilation/Linking
.wixprojprojects are not used because they require NuGet restore to run. Because the projects are generated inside a running build (after restore executed), it would require running nested restore operations for each project. Additionally, these projects all use the same set of packages so builds would incur unnecessary overhead across a large set of projects (1 per MSI).Other templates
Besides generating MSIs for workloads, the underlying tasks also need to generate the corresponding SWIX authoring for Visual Studio and NuGet packages for the MSI payloads. All of these actions require specific projects. The class hierarchy has been modified to ensure that common features around the various templates can be properly shared.
classDiagram class WorkloadTemplateBase { <<abstract>> +string OutputPath #Dictionary~string, string~ ReplacementTokens #IEnumerable~string~ Files #string TemplateOutputPath #string SourcePath #string IntermediateOutputPath +Build() void +Create() string +AddFile(templateFilename, replaceTokens) string +AddFile(templateFilename, destinationFilename, replaceTokens) string +AddSourceFile(path) void } class MsiBase { <<abstract>> } class MsiPayloadPackageProject class SwixProjectBase { <<abstract>> } class WorkloadManifestMsi class WorkloadPackGroupMsi class WorkloadPackMsi class WorkloadSetMsi class ComponentSwixProject class MsiSwixProject class PackageGroupSwixProject WorkloadTemplateBase <|-- MsiBase WorkloadTemplateBase <|-- MsiPayloadPackageProject WorkloadTemplateBase <|-- SwixProjectBase MsiBase <|-- WorkloadManifestMsi MsiBase <|-- WorkloadPackGroupMsi MsiBase <|-- WorkloadPackMsi MsiBase <|-- WorkloadSetMsi SwixProjectBase <|-- ComponentSwixProject SwixProjectBase <|-- MsiSwixProject SwixProjectBase <|-- PackageGroupSwixProject