In a localized program containing a culture neutral XAML file, some culture neutral icons and localized strings, how do you organize these different resource types so they can all be found? No matter what arrangement I try, I find that one of my resource types is inaccessible.
The problem that I'm having is:
The MainWindow.xaml file always builds into the en-US satellite assembly. If the UltimateResourceFallbackLocation is set to MainAssembly, it will never find the Window's BAML and I get an exception in the InitializeComponent() call. So I feel forced to set UltimateResourceFallbackLocation to "Satellite".
The culture neutral icon resources contained in the Resources.resx file always builds into the main EXE assembly and cannot be found if the UltimateResourceFallbackLocation is set to Satellite. This would appear to be totally incompatible with the requirements of the MainWindow.xaml file.
If I remove the UICulture and NeutralResourcesLanguage entirely – which forces the XAML and RESX data to both build into the MainAssembly, then my culture-specific strings don't work.
The question is: what am I doing wrong? How am I supposed to build the project so that these three types of resources are all accessible.
Edit (working solution but it seems wrong):
I have managed to get my culture neutral RESX file, Resources.resx, to build into the Satellite assembly by duplicating it entirely, renaming the duplicate Resources.en-US.resx and setting Resources.resx to Build Action:None (so Resources.resx is only used for generating the Resources.Designer.cs file but doesn't insert data into the Main EXE assembly anymore).
The program does now work for all three cases (localized strings, non-localized data from resx and non-localized data from XAML) since all my culture neutral resources are now in the en-US assembly – but duplicating the Resources.resx file to achieve this seems pretty silly.
Is it silly? Is there a smarter way to do this?