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

[MAUI] File.Designer.cs is not generated for File.resx placed in MAUI Library #23716

Open
wojciech-kulik opened this issue Jul 19, 2024 · 2 comments
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@wojciech-kulik
Copy link

wojciech-kulik commented Jul 19, 2024

Description

I migrated my shared Xamarin project to .NET MAUI Library. I need to use translations that are stored there. They need to be accessible from this library and from the MAUI app project that references this library.

However, when I copied Resources/File.resx to my MAUI Library, it doesn't auto-generate the corresponding Resources/File.Designer.cs file. I can create it manually, but I would like it to be auto-generated.

Steps to Reproduce

  1. Create MAUI Library (net8.0-android)
  2. Create MAUI App and reference MAUI Library.
  3. Add Resources/Strings.resx with sample translations to MAUI Library.
  4. Compile the app

Link to public reproduction project repository

No response

Version with bug

8.0.3 GA

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

No.

I tried adding it manually to csproj but it doesn't help:

  <ItemGroup>
    <Compile Update="Resources\Strings.Designer.cs"> 
      <DependentUpon>Strings.resx</DependentUpon>  
      <DesignTime>True</DesignTime>
      <AutoGen>True</AutoGen> 
    </Compile> 
  </ItemGroup>
  <ItemGroup>
    <EmbeddedResource Update="Resources\Strings.resx"> 
      <Generator>ResXFileCodeGenerator</Generator> 
      <LastGenOutput>Strings.Designer.cs</LastGenOutput> 
    </EmbeddedResource>
  </ItemGroup>

Relevant log output

No response

@wojciech-kulik wojciech-kulik added the t/bug Something isn't working label Jul 19, 2024
Copy link
Contributor

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@Eilon Eilon added the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label Jul 19, 2024
@Zhanglirong-Winnie Zhanglirong-Winnie added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert labels Jul 22, 2024
@Zhanglirong-Winnie
Copy link

This issue has been verified using Visual Studio 17.11.0 Preview 4.0(8.0.61&8.0.3). Can repro on all platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants