Skip to content

Update the manifest resource names for the localized resources embedded in satellite assemblies - #27756

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
daxian-dbw:manifest-name
Aug 3, 2026
Merged

Update the manifest resource names for the localized resources embedded in satellite assemblies#27756
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
daxian-dbw:manifest-name

Conversation

@daxian-dbw

Copy link
Copy Markdown
Member

PR Summary

Update the manifest resource names for the localized resources embedded in satellite assemblies.

When embedding the English .resx resources, .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 .resx files are right under the resources folder.

The C# binding types we generate from ResGen use this exact name (for instance, System.Management.Automation.resources.AuthorizationManagerBase) to identify this embedded resource.

With the folder structure of our localized .resx resources as resources\<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 .resx files are under the resources\<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 .resx files under the same resources folder, side-by-side with the English .resx files. That will make it hard to look for a .resx file for a particular langauge and also make it hard for ResGen to reliably find English .resx files 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

Copilot AI review requested due to automatic review settings August 3, 2026 17:56
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ManifestResourceName for localized .resx files (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 CORECLR DefineConstants blocks (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.

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit cb75674 into PowerShell:master Aug 3, 2026
42 of 43 checks passed
@daxian-dbw
Dongbo Wang (daxian-dbw) deleted the manifest-name branch August 3, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.6.x-Consider CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants