2

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?

Kiquenet
  • 14,494
  • 35
  • 148
  • 243
Fran Hoey
  • 895
  • 9
  • 18

1 Answers1

7

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.

Joe
  • 122,218
  • 32
  • 205
  • 338
  • I cant add a globalization element, so how do you change the regional settings on user profiles in Windows 7? – Fran Hoey Sep 27 '12 at 10:43
  • In Windows 7 you use Control Panel / Region / Administrative / Welcome screen and new user accounts / Copy settings – Joe Sep 27 '12 at 10:54
  • 1
    That worked! Although on my PC it was slightly different: Control Panel / Region / Administrative - Click "Copy Settings", select "Welcome Screen and system accounts", select "New User Accounts", click ok. I then had to create a new IIS App Pool (to create a new user) and change the website to use it. – Fran Hoey Sep 27 '12 at 13:25
  • @FranHoey, I would have expected that to work for the existing applicaiton pool, but you would need to recycle the application pool first, or perhaps even reboot the machine. Glad it worked anyway. – Joe Sep 27 '12 at 13:34
  • that was my feeling to, but even a reboot didn't do it. Its one of the IIS APPPOOL\ accounts so maybe it's not classed as a system account. Thanks anyway, that's been bugging me for ages. – Fran Hoey Sep 27 '12 at 15:10