Repository navigation
Fix CS0234 in BaseDirectory auto-initializer (qualify System.Globalization with global::) - #6625
Closed
v-arlysenko wants to merge 2 commits into
Closed
v-arlysenko wants to merge 2 commits into
v-arlysenko wants to merge 2 commits into
Conversation
…ation with global:: The generated WindowsAppRuntimeBaseDirectoryAutoInitializer.cs lives in namespace Microsoft.Windows.ApplicationModel.WindowsAppRuntime.BaseDirectoryCS. When compiled into a consumer that references the Microsoft.Windows.System WinMD, the leading 'System' in 'System.Globalization.CultureInfo' binds to Microsoft.Windows.System (via the enclosing Microsoft.Windows namespace) instead of the root System namespace, producing CS0234 (namespace 'Globalization' does not exist in 'Microsoft.Windows.System'). This broke TransportPackage-Foundation-Nightly. Qualify with global:: to force the root namespace.
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Scott Jones (Scottj1s)
approved these changes
Jul 17, 2026
Contributor
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
Contributor
Author
|
/azp run WindowsAppSDK-Templates-PR |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
Author
|
/azp run TransportPackage-Foundation-PR |
|
No pipelines are associated with this pull request. |
Contributor
Author
|
Duplication |
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
TransportPackage-Foundation-Nightly (OneBranch)onmain(commit aa197a5) fails with:WindowsAppRuntimeBaseDirectoryAutoInitializer.cs(32,48): error CS0234:
The type or namespace name 'Globalization' does not exist in the namespace 'Microsoft.Windows.System'
Root cause
dev/Common/WindowsAppRuntimeBaseDirectoryAutoInitializer.cs(added in #6619) lives innamespace
Microsoft.Windows.ApplicationModel.WindowsAppRuntime.BaseDirectoryCS. When thefile is compiled into a consumer that references the
Microsoft.Windows.SystemWinMD, theleading
SysteminSystem.Globalization.CultureInfobinds toMicrosoft.Windows.System(reachable via the enclosing
Microsoft.Windowsnamespace) instead of the rootSystemnamespace → CS0234. A standalone compile doesn't hit this, which is why #6619 passed but
the nightly transport build (with Microsoft.Windows.System in scope) broke.
Fix
Qualify with
global::System.Globalization.CultureInfo.InvariantCultureto force the rootnamespace. Matches the existing convention in the repo (e.g. VSPackage.Designer.cs).