Repository navigation
[2.0-stable] Fix CS0234 in UndockedRegFreeWinRT auto-initializer (qualify System.Globalization with global::) - #6669
Merged
Conversation
…lobalization with global:: The auto-initializer ships inside the Microsoft.WindowsAppSDK.Foundation nuget and is compiled into consumer app projects under namespace Microsoft.Windows.Foundation.UndockedRegFreeWinRTCS. When the app also references the Microsoft.Windows.System namespace (e.g. EnvironmentManager or PowerManager), the unqualified leading 'System' in 'System.Globalization.CultureInfo' binds to Microsoft.Windows.System instead of the BCL System, producing: error CS0234: The type or namespace name 'Globalization' does not exist in the namespace 'Microsoft.Windows.System' This broke every C# sample in the Foundation official build. Prefix the reference with global:: so it always resolves to the BCL System namespace. This is the servicing equivalent of the main-branch fix #6633 (commit 37de565), which resolved the identical CS0234 after the base-directory child-process isolation change (#5987). The servicing port inlined the base-directory stamping into this file and did not carry the #6633 follow-up.
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
Manodasan Wignarajah (manodasanW)
approved these changes
Aug 3, 2026
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.
Problem
Build
TransportPackage-Foundation-Officialonrelease/2.0-stable(2.3.8-stable, buildId 153733386) fails: every C# sample in theBuild all Sample solutionsstage errors with:Root cause
dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.csships in the Foundation nuget and is<Compile>-injected into consumer apps undernamespace Microsoft.Windows.Foundation.UndockedRegFreeWinRTCS. Those apps also reference theMicrosoft.Windows.Systemnamespace (EnvironmentManager / PowerManager). C# resolves the leadingSystemofSystem.Globalization.CultureInfoagainst the nearest enclosing namespace, findsMicrosoft.Windows.System, and fails to locateGlobalizationthere -> CS0234. (using System;does not help; it only affects simple-name lookup, not the leading token of a qualified name.)The offending line was introduced by the gated servicing port #6632 (base-directory child-process isolation, #5987), which inlined the base-directory PID stamping into this file without the
global::qualifier.Fix
Qualify with
global::System.Globalization.CultureInfo.InvariantCultureso it always binds to the BCLSystem. IL is unchanged; this is a name-resolution-only fix.Precedent
This is the direct servicing backport of #6633 (commit 37de565), which fixed the identical CS0234 on
main(WindowsAppRuntimeBaseDirectoryAutoInitializer.cs(32,48)). Themainnightly went red Jul 16 and green from Jul 18 onward once #6633 merged; it has stayed green through Aug 2.