In my windows service, Spring.NET creates some threads handling jobs. Is it possible to make sure all these threads are started with a specific culture? Or do I have to set the culture in each thread?
In ASP.NET, you can set the culture (globalization tag in web.config) at application level… can this be done in Windows Forms/Windows Service?
Unfortunately, there is no way to set the culture globally for all future threads. They will always have the current system culture by default. So you have to explicitly set the culture through the
CurrentCultureproperty (note that you can set it before you actually start the thread)EDIT: .NET 4.5 will provide a new
CultureInfo.DefaultThreadCurrentCultureproperty that lets you set the default culture for all new threads in the current application domain (CultureInfo.DefaultThreadCurrentUICultureis also available)