mercredi 19 avril 2017

C# Class Library with Localization strings as Resources

I have C# solution with common project (class library) with localization strings added as resources. There where no problems to use this project as reference in other projects in solution and set Culture.

I would like to move common project to other solution and use it as dll reference. When the common project is referenced as dll changing Culture has no impact on localization strings in dll.

I have tried to merge common project to one dll using ILMerge selecting main dll and all resource dlls for all languages. Changing Culture also has no impact on merged dll.

In both cases dll use default neutral culture to get localization strings, even after curent culture is set as

Thread.CurrentThread.CurrentCulture = cultureInfo;

What is the best practice to build class library project with localization strings as resources and later reference it.


0 commentaires:

Enregistrer un commentaire