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)
@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.
Hope it helps!
@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.
Actually, looks like it might be a MAUI bug. https://github.com/dotnet/maui/issues/7443#issuecomment-1406701369