'Publish to arm64 not working when cultured resx file added

I've created a .Net 6.0 project that uses resx files for localization. In a Properties folder a Resources.resx file was added (Build action: EmbeddedResource CustomTool: ResxFileCodeGenerator) I was able to publish this to arm-64. Here is the pubxml file:

<Project>
  <PropertyGroup>
    <Configuration>Debug</Configuration>
    <Platform>Any CPU</Platform>
    <PublishDir>bin\\publish\</PublishDir>
    <PublishProtocol>FileSystem</PublishProtocol>
    <TargetFramework>net6.0</TargetFramework>
    <RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
    <SelfContained>true</SelfContained>
    <PublishSingleFile>false</PublishSingleFile>
    <PublishTrimmed>false</PublishTrimmed>
  </PropertyGroup>
</Project>

Then I add a Resources.nl.resx file into the properties folder (Build action: EmbeddedResource) When I try to publish now it fails saying that 'arm64' is not a valid setting for option 'platform' These are the last lines from the output:

2>C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\al.exe /culture:nl /out:obj\Debug\net6.0\linux-arm64\nl\LocalizationResx.resources.dll /platform:arm64 /template:obj\Debug\net6.0\linux-arm64\LocalizationResx.dll /embed:obj\Debug\net6.0\linux-arm64\LocalizationResx.Properties.Resources.nl.resources

2>'arm64' is not a valid setting for option 'platform'

The publish works if I set linux-arm as target runtime.

Is this a bug in visual studio? (2022 v17.1.0)

Is there a way to make the publish succesfull?

Is there a better way to do localization for .net 6.0 projects that need to run on an arm64?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source