Repository navigation
[1.8-stable] Fix CS0234 in UndockedRegFreeWinRT auto-initializer (qualify System.Globalization with global::) - #6670
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
dev/UndockedRegFreeWinRT/UndockedRegFreeWinRT-AutoInitializer.csonrelease/1.8-stablecarries a latent CS0234 that breaks any C# app consuming the Foundation package with undocked reg-free WinRT auto-init enabled:Note: the 1.8-stable
TransportPackage-Foundation-Officialpipeline has no sample-build stage, so this is not caught by CI here, but it is byte-identical to the 2.0-stable break (see companion PR #6669) and ships broken to consumers.Root cause
The file is
<Compile>-injected into consumer apps undernamespace Microsoft.Windows.Foundation.UndockedRegFreeWinRTCS. The unqualified leadingSysteminSystem.Globalization.CultureInfobinds to the SDK'sMicrosoft.Windows.Systemnamespace (nearest enclosing scope) instead of the BCLSystem-> CS0234. Introduced by the gated servicing port #6631 (base-directory child-process isolation, #5987), which inlined the base-directory PID stamping withoutglobal::.Fix
Qualify with
global::System.Globalization.CultureInfo.InvariantCulture. IL is unchanged; name-resolution-only fix.Precedent
Direct servicing backport of #6633 (commit 37de565), which fixed the identical CS0234 on
main. Companion 2.0-stable fix: #6669.