Update the manifest resource names for the localized resources embedded in satellite assemblies - #27756
Merged
Dongbo Wang (daxian-dbw) merged 2 commits intoAug 3, 2026
Conversation
Dongbo Wang (daxian-dbw)
requested review from
a team and
Justin Chung (jshigetomi)
as code owners
August 3, 2026 17:56
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates how localized .resx files are embedded into satellite assemblies so their manifest resource names match the naming pattern expected by the existing ResGen-generated C# binding types.
Changes:
- Explicitly sets
ManifestResourceNamefor localized.resxfiles (resources\*\*.resx) across multiple projects to remove the culture folder segment from the manifest resource name. - Adds a new Pester test suite to validate localized resource folder/file layout and presence of satellite assemblies.
- Removes redundant per-project
CORECLRDefineConstantsblocks (now centralized elsewhere).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/powershell/engine/ResourceValidation/LocalizedResource.Tests.ps1 | Adds validation for localized resource layout and satellite assembly presence (contains a path bug noted in PR comments). |
| src/System.Management.Automation/System.Management.Automation.csproj | Overrides manifest resource naming for localized .resx files. |
| src/Microsoft.WSMan.Management/Microsoft.WSMan.Management.csproj | Overrides manifest resource naming for localized .resx files. |
| src/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.csproj | Overrides manifest resource naming for localized .resx files. |
| src/Microsoft.PowerShell.CoreCLR.Eventing/Microsoft.PowerShell.CoreCLR.Eventing.csproj | Overrides manifest resource naming for localized .resx files. |
| src/Microsoft.PowerShell.ConsoleHost/Microsoft.PowerShell.ConsoleHost.csproj | Overrides manifest resource naming for localized .resx files. |
| src/Microsoft.PowerShell.Commands.Utility/Microsoft.PowerShell.Commands.Utility.csproj | Overrides manifest resource naming for localized .resx files. |
| src/Microsoft.PowerShell.Commands.Management/Microsoft.PowerShell.Commands.Management.csproj | Overrides manifest resource naming for localized .resx files. |
| src/Microsoft.PowerShell.Commands.Diagnostics/Microsoft.PowerShell.Commands.Diagnostics.csproj | Overrides manifest resource naming for localized .resx files. |
| src/Microsoft.Management.UI.Internal/Microsoft.PowerShell.GraphicalHost.csproj | Overrides manifest resource naming for localized .resx files. |
| src/Microsoft.Management.Infrastructure.CimCmdlets/Microsoft.Management.Infrastructure.CimCmdlets.csproj | Overrides manifest resource naming for localized .resx files. |
Patrick Meinecke (SeeminglyScience)
approved these changes
Aug 3, 2026
Dongbo Wang (daxian-dbw)
merged commit Aug 3, 2026
cb75674
into
PowerShell:master
42 of 43 checks passed
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.
PR Summary
Update the manifest resource names for the localized resources embedded in satellite assemblies.
When embedding the English
.resxresources, .NET SDK uses the manifest resource names$(RootNamespace).resources.<resx-file-name-without-extension>by default, e.g.System.Management.Automation.resources.AuthorizationManagerBase. The.resources.part is because the English.resxfiles are right under theresourcesfolder.The C# binding types we generate from
ResGenuse this exact name (for instance,System.Management.Automation.resources.AuthorizationManagerBase) to identify this embedded resource.With the folder structure of our localized
.resxresources asresources\<lang-id>\<name>.<lang-id>.resx, by default .NET SDK will use the manifest resource names$(RootNamespace).resources.<lang-id>.<resx-file-name-without-extension>for the localized resources embedded in the satellite assemblies, e.g.System.Management.Automation.resources.zh-Hans.AuthorizationManagerBase.zh-Hans. The.resources.<lang-id>.part is because the localized.resxfiles are under theresources\<lang-id>folders.So, the default resource embedding by .NET SDK doesn't work for the folder structure of localized resources we adopt in PowerShell project.
To make the .NET SDK default work, we will have to put all localized
.resxfiles under the sameresourcesfolder, side-by-side with the English.resxfiles. That will make it hard to look for a.resxfile for a particular langauge and also make it hard forResGento reliably find English.resxfiles only. So, I decide to go with the current folder structure and fix the manifest resource names for satellite assemblies by explicitly defining those names.With this PR, the manifest resource names used in satellite assemblies are like
<RootNamespace>.resources.<Filename>.<Lang-id>, like'System.Management.Automation.resources.AuthorizationManagerBase.zh-Hans, which works fine with the C# binding types we generate today.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header