Fix Ribbon control PackageId evaluation order#749
Merged
Arlodotexe merged 1 commit intomainfrom Oct 8, 2025
Merged
Conversation
Move Import statement before PackageId PropertyGroup to ensure $(PackageIdVariant) is defined when PackageId is evaluated. Previously, PackageId referenced $(PackageIdVariant) before the Import that defines it, resulting in malformed package identifiers like 'CommunityToolkit..Controls.Ribbon' (with empty variable). This prevented Ribbon packages from being published to NuGet feeds. All other controls have Import before PackageId and work correctly. This aligns Ribbon with the established pattern. Fixes #739
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.
Summary
Fixes the Ribbon control not publishing to NuGet feeds by correcting the evaluation order of
PackageIdand theImportstatement in Ribbon.csproj.Fixes #739
Problem
The Ribbon control has been missing from all NuGet artifact sets (WinUI 0, 2, and 3) in weekly CI releases. Investigation revealed that
PackageIdwas being evaluated before importing the props file that defines$(PackageIdVariant), resulting in malformed package identifiers likeCommunityToolkit..Controls.Ribbon(note the double dot from the empty variable).Root Cause
In
Ribbon.csproj, thePackageIdPropertyGroup appeared before the Import statement:Since MSBuild evaluates properties in document order,
$(PackageIdVariant)was undefined whenPackageIdwas evaluated. The variable is only defined after importingToolkitComponent.SourceProject.props(via the chain: ToolkitComponent.SourceProject.props → Library.props → WinUI.TargetVersion.props).Solution
Move the Import statement to appear before the PackageId PropertyGroup:
This ensures
$(PackageIdVariant)is defined whenPackageIdis evaluated.Validation
This fix aligns Ribbon with the established pattern used by all other controls:
Control Experiment
Notably, PR #719 (commit 4e42800) added
PackageIdto both Ribbon and OpacityMaskView in the same commit:This demonstrates that placement order is the causative factor.
Testing
Impact