PC Regional and Language Settings are being ignored in .Net

我与影子孤独终老i 提交于 2019-12-01 08:57:11

问题


I know I'm not alone in this, but I'm yet to find a solution.

My PC Regional and Language settings are all English (United Kingdom) but .Net is using US formats for dates and currencies.

I've checked the machine config and web config and there are no globalization settings and I don't want to add them.

Is there another setting somewhere I've missed?


回答1:


You use the ASP.NET tag: I suspect you are running the application under an identity without its own profile, and it is using the default regional settings stored in the registry under 'HKEY_USERS.Default\Control Panel\International`.

These aren't necessarily the same as the regional settings of an interactive user.

You can do one of two things:

  • Add a <globalization> element to your web.config. This is probably the best solution, as it makes your app independent of the regional settings of the hosting server.

  • Use Control Panel to set the regional settings you want for the current user and for the default user profile. The exact steps depend on the Windows version you're using.



来源:https://stackoverflow.com/questions/12619320/pc-regional-and-language-settings-are-being-ignored-in-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!