I have System.Timers.Timer that performs some operations based on schedule. When timer rise开发者_开发知识库s event, the threads culture is 'ru-RU' differ from culture in my web config.
<globalization culture="en-US" uiCulture="en-US" requestEncoding="utf-8" responseEncoding="utf-8" />
I guess the culture in timer handler based on my regional settings which is ru-RU. Currently i set it manually to 'en-US' in timer handler, but i think this is not the best way to solve the problem.
In any case is there another solution to have the same culture in another thread as in my web config except setting it manually?
That is very strange. Every thread that creates another thread will pass on all the context including security and locale.
Add a debug code to check the Culture
and UICulture
of the Thread.CurrentThread
at the time of creation of thread.
精彩评论