开发者

Can CultureInfo.CurrentCulture differ per application pool?

开发者 https://www.devze.com 2023-01-03 04:58 出处:网络
I\'m having trouble with CultureInfo in our ASP.NET web application. Our web application returns a different culture, depending on which application pool it is in.

I'm having trouble with CultureInfo in our ASP.NET web application. Our web application returns a different culture, depending on which application pool it is in.

In application pool A, it is en-US, but in application pool B, it's nl-BE.

I'd like it to be nl-BE, but can't find where to change this (IIS6 by the way). I'm not even sure if this can be changed on an app-pool level.

I'm checking with C开发者_JAVA技巧ultureInfo.CurrentCulture.Name.

Is it possible to change this for an application pool? Or what else could influence this? In the regional settings of the server, we have selected 'Dutch (Belgium)', which translates to nl-BE, I believe. So where could this application pool be getting the en-US?


Yes, it can be different. It's a per-thread property. You can set CurrentCulture for each thread separately.

Are you sure you are not altering the setting somewhere in code? Is <globalization> setting identical for both tests?

If you want to force a specific culture, try something like:

<globalization culture="en-US" uiCulture="en-US" />
0

精彩评论

暂无评论...
验证码 换一张
取 消