In my ASP.NET applicatio开发者_如何学运维n I set
<system.web><globalization culture="pl-PL" uiCulture="pl-PL" />
to have numbers and dates in this culture.
Surprisingly I noticed that methods invoked from job scheduler (Quartz library) use en-US? Why is that?
web.config globalization is relatively simple - it sets thread locale when request is being processed. you seem to be invoking methods from another non-asp.net thread, using Quartz.NET scheduler. The invoker has to set thread locale before calling your methods, so in your job code, set locale manually, then call methods you need, like so:
Thread.CurrentThread.CurrentCulture = new CultureInfo("pl-PL");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("pl-PL");
精彩评论