简体   繁体   中英

VS C# CultureInfo set permanently to value within the IDE?

I've got a German VisualStudio 9.0. Working with doubles and doing quite some parsing, I came into trouble because of the decimal separator.

What I'm looking for is a way to either switch the whole IDE (and therefore all the projects created with it) to "en-gb" or do it project wide. I chose en-gb because of the lack of am's and pm's which I don't need.

I tried to set it by using Thread.CurrentThread.CurrentCulture , but this regards only the one thread. Then I found the Application wide setting, which seems to be not what I'm looking for when developing console applications.

Any idea? Thank you for reading.

The culture of the application defaults to the culture of the machine it's running on, not the machine it was developed on. The IDE is irrelevant here.

If you need to parse/format values using a specific culture, I suggest you do that explicitly - changing the current culture of all threads would be incorrect in almost all settings, IMO.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM