question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resx file does not produce designer file, application is crashing

See original GitHub issue

Description

Hello there!

I’m in the process of migration TaskLoaderView to MAUI, it was going alright till I launch the app for the first time. It crashed right after the Splashscreen. It was complaining about my resx file (located in Resources\Localization\SampleResources.resx), not being embedded in the resources… After that I tried a few things, and now it seems even worst: it crashes before the splash, when loading resources assemblies:

[monodroid-assembly] open_from_bundles: failed to load assembly en-US/Retronado.Maui.resources.dll
[monodroid-assembly] open_from_bundles: failed to load assembly en-US/Retronado.Maui.resources.dll
[monodroid-assembly] open_from_bundles: failed to load assembly en/Retronado.Maui.resources.dll
[monodroid-assembly] open_from_bundles: failed to load assembly en/Retronado.Maui.resources.dll
[.retronado.mau] * Assertion: should not be reached at /__w/1/s/src/mono/mono/mini/mini-exceptions.c:456
[libc] Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 9031 (.retronado.maui), pid 9031 (.retronado.maui)

I think it is related to the resx file, cause It fails to generate the design file when building the project on Rider EAP AND on VS Mac Preview.

Steps to Reproduce

Here is the repo sample:

https://github.com/roubachof/Sharpnado.TaskLoaderView/tree/failing-resx

  • Project is Retronado.Maui
  • The resx is Resources\Localization\SampleResources.resx

Version with bug

6.0 (current) VS for Mac preview 17.3 build 191

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 21 and up, probably iOS, since resx doesn’t generate anything

Did you find any workaround?

nope

Relevant log output

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:21 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jonathanpepperscommented, Jun 30, 2022

So the error is:

System.Resources.MissingManifestResourceException: Could not find the resource "Sample.Localization.SampleResources.resources" among the resources "Retronado.Maui.Resources.Localization.SampleResources.resources", "Retronado.Maui.App.xaml", "Retronado.Maui.MainPage.xaml", "Retronado.Maui.Platforms.Windows.App.xaml", "Retronado.Maui.Resources.Styles.Colors.xaml", "Retronado.Maui.Resources.Styles.Global.xaml", "Retronado.Maui.Resources.Styles.Icons.xaml", "Retronado.Maui.Resources.Styles.Sizes.xaml", "Retronado.Maui.Resources.Styles.StylesGameView.xaml", "Retronado.Maui.Resources.Styles.Text.xaml", ... embedded in the assembly "Retronado.Maui", nor among the resources in any satellite assemblies for the specified culture. Perhaps the resources were embedded with an incorrect name.

I see the .resources file in here with a different name: image

The file in there matches the $(RootNamespace) of this project:

<EmbeddedResource Update="Resources\Localization\SampleResources.resx">

Are you somehow bringing in the source code for this class within this assembly?

image

I don’t really understand how these projects are setup, but it looks like Samples.csproj is expecting the .resources file to be named based on its $(RootNamespace). Your app has the $(RootNamespace) of Retronado.Maui.

We have some tests in .NET 6 for .resx, so it seems like they are generally working:

https://github.com/xamarin/xamarin-android/blob/main/tests/Mono.Android-Tests/Localization/LocalizationTests.cs

0reactions
jfversluiscommented, Jan 16, 2023

I think this was fixed, if not, please let us know!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Editing resource file crashes Visual Studio
Every time I try to edit any resource file in any UWP project in my solution, Visual Studio crashes and restarts. I've not...
Read more >
Parsing Resx file with C# crashes on relative paths
i am getting errors as they can't parse the relative path. they end up going to folders that do not exist in my...
Read more >
New resx item does not exist in the runtime even after ...
Our resources are in the special folder named App_GlobalResources. When modifying a resx file, the designer file is modified by Rider. There is...
Read more >
Serious problem, report is crashing Visual studio
Hi all, I got a serious problem with a report which started when I renamed it, it first complained about something in the...
Read more >
Visual Studio 2010 crashes when you select text and try ...
I can work around this by opening the resx file and cutting the code out of there, saving the repx file (with no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found