'Setting "Assembly neutral Language" destroys GUI
I have a C#-Desktop-app with some GUI that look likes this in the Designer:
The Property "Localizable" ist set to True and "Language" is "German". Right now there is only only language (german) but maybe in the futre there will be others as well. When startet the GUI looks like it should - like in the designer.
However the "Error List"-window gave me a warning about "Assembly neutral Language" not set. So I go the project-settings and set it as well to "German" beacuse thats the only supportes language right now. When I start the GUI now it looks messed up:
Setting the "Assembly neutral language" to "English" makes the GUI working again but I don't get the point here. Why is it that "German" messes it up?
Solution 1:[1]
You can try the following.
Add to the AssemblyInfo.cs the following code:
using System.Resources;
[assembly: NeutralResourcesLanguage("de")]
In your MainForm.resx use the German texts instead of the English texts.
You may need to add the NuGet package System.Resources.ResourceManager
as well if it has not yet been added to your project.
See: c# warning - Mark assemblies with NeutralResourcesLanguageAttribute
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Arjan |