

Localization (or anything else for that matter), the app no longer crashed and the resources have loaded well. Also, to make things more “Sherlocky”, the exception will appear only when the localized resources are used and will not show up with the neutral culture. Everything will otherwise work, compilation will go through flawlessly. Resources your app will crash with MissingManifestResourceException at runtime. Do NOT end the name of your PCL with “.Resources”! I was completely lost until I tried something counterintuitive and it worked – I changed the name of the PCL assembly. After a bit more fiddling around with ResourceManager , the exception description got even more “helpful”: An exception of type '' occurred in mscorlib.ni.dll but was not handled in user codeĪdditional information: Unable to load resources for resource file "" in package "9b09bfd8-2a50-4a1f-baae-e90b760e48c7". This comes down to the which can be found in the Package.appxmanifest file.Īfter rebuild and relaunch, the exception persisted. Note that this is necessary anyway ! If you don’t include the RESW files in the UWP project, the packaging process will not notice the non-neutral translations and your app will not be available in the languages you intend. I have noticed the reference to RESW files in the description so I decided to add “dummy” RESW files to the UWP app project for all supported languages. In my case the exception started up when I tried to simply access a localized string resource: : 'MissingManifestResource_ResWFileNotLoaded, ' First form of the exception The two forms of MissingManifestResourceException Until you get a MissingManifestResourceException . LocalizedStrings.resx (neutral), .resx (German), LocalizedStrings.cs.resx (Czech).Īt runtime the CultureInfo.CurrentUICulture is checked and references to your resource class are directed at the proper localized version of the resources.
#Visual studio resx localization code
First you create a new PCL, add in a RESX resource file, set its code generation to public and then add more localized resource files with the same name but additional culture-tag extension – e.g. Such resource sharing infrastructure is quite easy to set up.
#Visual studio resx localization portable
Basically it is almost exactly the same as RESX, but has a different extension. The truth is, that cross-platform mobile developers usually prefer having shared string resources across all platforms and for this purpose a Portable Class Library is used. UWP applications have added a new format for resource management – RESW. I have experienced this pain first hand in the form of cryptic MissingManifestResourceException errors and want to share with you when they can occur and also to have a reminder if I hit this problem again. Localization is fun when it works, but pain when it does not.
