1

I have an application that appears to sometimes set the CurrentThread culture, and of course it implicitly uses that culture everywhere (String.Format(), DateTime.ToString() etc. etc.).

It is not clear to me what happens with the culture in the thread. After the request ends, the thread stays alive in the application pool. Is the thread still set to that culture? Will the pre-set culture be used in the next request?

I have IIS set to prefer InvariantCulture but can I rely on my application to have that culture when I need it, unless I change the culture?

Jacob Bruinsma
  • 1,087
  • 1
  • 10
  • 23
  • I can't check right now but it is my impression that the server thread locale is set based on the user's browser setting as each request comes in. – 500 - Internal Server Error Jan 13 '15 at 15:24
  • It is if you set it in your web.config (system.web > globalization) - by default, that setting seems to be missing. Hence my question. – Jacob Bruinsma Jan 14 '15 at 07:07
  • This question contains related information: http://stackoverflow.com/questions/1467194/does-changing-the-culture-of-a-threadpool-thread-affect-it-when-it-gets-returned?rq=1 But no conclusion was drawn, other than not to rely on IIS changing thread properties. – Jacob Bruinsma Jan 16 '15 at 09:10

0 Answers0