Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Satellite assemblies with un-predefined cultures are not copied correctly into depended projects #10536

Closed
PopSlime opened this issue Aug 20, 2024 · 1 comment · Fixed by #11000
Assignees
Labels
bug Cost:M Work that requires one engineer up to 2 weeks Localization Priority:2 Work that is important, but not critical for the release triaged

Comments

@PopSlime
Copy link

PopSlime commented Aug 20, 2024

Issue Description

Satellite assemblies with un-predefined cultures in a project are not copied correctly into the projects that depends on it.

Steps to Reproduce

Assume that yue is not a predefined language in the system.

  1. Create a project (Project A) with two resources named Test.resx and Test.yue.resx respectively.
  2. Add the following metadata into Project A:
    <PropertyGroup>
    	<RespectAlreadyAssignedItemCulture>True</RespectAlreadyAssignedItemCulture>
    </PropertyGroup>
    <ItemGroup>
    	<EmbeddedResource Update="Test.resx">
    		<Generator>ResXFileCodeGenerator</Generator>
    	</EmbeddedResource>
    	<EmbeddedResource Update="Test.yue.resx">
    		<Culture>yue</Culture>
    		<LogicalName>Test.yue.resources</LogicalName>
    	</EmbeddedResource>
    </ItemGroup>
  3. Create another project (Project B) that has a project reference to Project A.
  4. Create another project (Project C) that has a project reference to Project B.
  5. Build the projects.

Expected Behavior

The satellite assembly for the culture yue is correctly copied into Project B and Project C, and also written into their .deps.json.

Actual Behavior

  • The satellite assembly for the culture yue is not copied into Project C at all.
  • The .deps.json in both Project B and Project C do not include the satellite assembly for the culture yue.

Analysis

Suspicious related method: ReferenceTable.FindSatellites()

if (CultureInfoCache.IsValidCultureString(cultureName))

This method cannot find satellite assemblies with unusual cultures because it is still checking the satellite directory name against CultureInfoCache only.

Related issues and PRs:

Versions & Configurations

MSBuild version: 17.11.2.32701

@PopSlime PopSlime added the bug label Aug 20, 2024
@maridematte maridematte added Cost:M Work that requires one engineer up to 2 weeks Priority:2 Work that is important, but not critical for the release triaged Localization labels Aug 20, 2024
@PopSlime
Copy link
Author

Switching to another resource workflow as this issue seems to be put aside for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Cost:M Work that requires one engineer up to 2 weeks Localization Priority:2 Work that is important, but not critical for the release triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants