CurrentCulture incorrectly defaulting to en-US in ASP.net

后端 未结 9 1231
执笔经年
执笔经年 2020-12-08 14:37

I have just migrated around 100 ASP.net sites from IIS 6 on Windows Sever 2003 to IIS 7 on Windows 2008. I\'ve just noticed that various pieces of code that use things like

相关标签:
9条回答
  • 2020-12-08 15:04

    It can come from the culture of a system account used to run the Application Pool or Web Application.

    Check this link: different culture settings between IIS and ASP.NET

    0 讨论(0)
  • 2020-12-08 15:07

    I had the same problem and after many hours I found out that even though the regional settings were correct, I also needed to change the original culture for all the reserved accounts (e.g. ASP.NET).

    This is done through the button "Copy Settings..." under the Administrative tab in Regional Settings. The settings are copied if you enable the checkbox "Welcome screen and system accounts".

    0 讨论(0)
  • 2020-12-08 15:09

    If I add a globalization section in the root web.config ( windir\Microsoft.NET\Framework\ver\Config\Web.config), set to en-GB, it does solve my problem and propagates down to the other sites. Which kinda solves my problem. Still doesn't explain where its getting en-US from by default though but it should do the trick. Thanks.

    0 讨论(0)
提交回复
热议问题