I’m using the Application Settings (via the project properties for a C# assembly) in order to store default values for the application, but I’m finding that the auto-generated code doesn’t work across different regional settings.
For example, if I use it store a float value called “Increment” with a value of 0.5 when set to an English culture, then the following code is generated:
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("0.5")] public float Increment { get { return ((float)(this["Increment"])); } set { this["Increment"] = value; } } |
However if I then run the application in a different culture (such as Spanish) and try to use this value, it throws an exception because the Spanish culture settings expect the float number to be in the format “0,5” and not “0.5”.
Is there any way to make the auto-generated settings code use the InvariantCulture, or is there any other way around this

Do application settings work across cultures?
DirtBag123
I've worked around the problem (for now) by converting all our existing settings to strings, and then doing a float.Parse(<setting>, CultureInfo.InvariantCulture) - or equivalent - wherever the setting is used.
Hugh Qu - MSFT
Unfortunately, the bug is not really in the designer generated code but rather in how the settings runtime will interpret the value (it was using locale dependent serialization in the beta2 release) so even if manually fix this value in the designer generated code, your beta2 application will not run correctly...
Best regards,
Johan Stenberg