Reputation: 436
I am just beginning to use the WPFLocalizeExtension in a project. It works, but it has a serious impact on the startup performance of the app. It tries to load the resources for all possible languages, including many which we won't ever provide resources for. Normally that might happen without notice, but in this case we have a special folder structure for some of the loaded assemblies. Although the resource DLLs are still situated in language folders directly beneath the folder of the executable, but the app gets an AssemblyResolve event for every language.
Thanks for your help in advance.
Upvotes: 1
Views: 399
Reputation: 11
We had the same problem and approached it by modifying the WPFLocalizeExtension source code.
When you have a look at the code, you will find a class called ResxLocalizationProviderBase. This class includes a method GetResourcemanager, which causes the massive amounts of AssemblyResolve events, because it tries to get the resource set of all cultures that ship with the .NET Framework (line 498):
var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
foreach (var c in cultures)
{
...
}
We modified the code by creating a list of CultureInfo objects, that includes only languages, we'd like to provide resources for.
Upvotes: 1