dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.17k stars 1.74k forks source link

AppResources.<lang>.resx files get ignored with windows x64 build #20828

Open nix365 opened 8 months ago

nix365 commented 8 months ago

Description

The files from AppResources.lang.resx get ignored and only the AppResources.resx file is being used

Steps to Reproduce

  1. Load the demo project from: https://github.com/dotnet/maui-samples/tree/main/8.0/Fundamentals/Localization
  2. Change the beginning of the LocalizationDemo.csproj to

    <PropertyGroup>
    <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
    <PublishSingleFile>true</PublishSingleFile>
    
    <OutputType>Exe</OutputType>
    <RootNamespace>LocalizationDemo</RootNamespace>
    <UseMaui>true</UseMaui>
    <SingleProject>true</SingleProject>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    
    <!-- Display name -->
    <ApplicationTitle>LocalizationDemo</ApplicationTitle>
    
    <!-- App Identifier -->
    <ApplicationId>com.companyname.localizationdemo</ApplicationId>
    
    <!-- Versions -->
    <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
    <ApplicationVersion>1</ApplicationVersion>
    
    <NeutralLanguage>en-US</NeutralLanguage>
    <DefaultLanguage>en</DefaultLanguage>
    
    <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
    <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
    <Platforms>x64</Platforms>
    </PropertyGroup>
  3. Start the application

Link to public reproduction project repository

https://github.com/dotnet/maui-samples/tree/main/8.0/Fundamentals/Localization

Version with bug

8.0.6 SR1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

net8.0-windows10.0.19041.0

Did you find any workaround?

no

Relevant log output

No response

jfversluis commented 8 months ago

By replacing the whole csproj you are leaving out the important part for picking up the ResX files, so that is the reason why it doesn't work I would think.

Does the demo work if you don't replace the whole csproj? Does your project work if you include those references to the ResX files?

ghost commented 8 months ago

Hi @nix365. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

nix365 commented 8 months ago

Thank you for your response and sorry for the confusion, I only replaced the PropertyGroup and did not touch the rest of the file.

kevinxufei commented 7 months ago

Can repro this issue on the latest 17.10 preview2.

SKeehnen commented 5 months ago

I have the same issue but then for Android. Windows seems to be working using .net 9 preview 4.