LocalizationResourceManager.Maui: FileNotFoundException

We have just an English and a French, but in trying to use this project we’re getting an exception:

.UseLocalizationResourceManager(settings =>
{
    settings.AddResource(AppResources.ResourceManager);
    settings.RestoreLatestCulture(true);
});

This is the exception: {System.IO.FileNotFoundException: File name: 'CabMdMobile.Maui.resources' at System.Reflection.Assembly.Load(AssemblyName assemblyRef, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext) at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(Assembly assembly, CultureInfo culture, Version version, Boolean throwOnFileNotFound)}

Not really sure why it’s having a problem. The files are in the same place as your example, have the same name “AppResources”, the settings for the files in the csproj seem to be the same as your sample as well.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

@arahmancsd , this is really strange!

Why does this work without any problem for me and most other users? The only thing I can come up with is that is something is different with your setup.

  • Try to update to the latest version of VS 2022 (Currently 17.5.5)
  • Try to disable the Android “Fast deployment” options setting for the sample project. (see image)

image

Hope it helps!

@arahmancsd , so to understand.

  • You successfully compile sample project in VS2022 in Windows?
  • You deploy/run sample project with “Windows Machine” as target and you get “FileNotFoundException” on the resource file?
  • If not, please describe every step.

@SirJohnK thanks, I am getting this error when running my project in Windows targeting Android and iOS. Surprisingly, I unchecked System.Exception from Debug menu and the project is working. Additionally, if you continue (F5) with the exception, the project keeps working. In both scenarios, the resource manager works fine.

In terms of exception, it is the same as stated in the question.

I have no idea at the moment If I can have a release build with that exception, but can check that later.