2

I am moving a copy of an ASP.net web application running on a windows server 2003 box to a Windows 7 Laptop.

On the win server 2003 box the locale was set to United States and shortdate format was M/DD/YYYY. On the Windows 7 machine it is DD/MM/YYYY which is breaking the application.

I have tried changing all the locale settings under controlpanel->regions to United States and rebooting with no luck. I also tried explcitly setting the shortdate format to M/DD/YYYY under the region settings but the web application seems to ignore it.

How can I change the Windows 7 shortdate format so an ASP.net application will recognize it ?

3 Answers 3

1

The best way would be to set this in the web application instead of on the operating system.

My guess is that when you try to change the locale it will only apply to the user you're logged in, and the web application is not running as that user. You'd have to change the default system locale somehow - though I think this is something the web application should take care of (.NET has support for setting any locale and date format through code/declarations).

1
  • 1
    I took your advice and added: <system.web><globalization culture="en-US" uiCulture="en-US" /> to the web.config file of the asp.net project and that worked. Thanks!
    – Element
    Apr 25, 2010 at 19:05
0

It appears there is a mishandling of the short date (and possibly the long date format too). I've just migrated form Vista Ultimate to windows 7 Home Premium.

I've set all my settings to English (Australia) in the Language & Region Settings (done all tabs, including the advanced settings), and set the short date to display as dd-MMM-yy

My pb is opposite to Element, I had dates showing as DD-MMM-YY under Vista, both in Excel 2007 and in MS-Money 2005, but they now show as DD-MM-YY. In Excel, these fields show with an * in the format, indicating that they rely on the default Region and Language settings, but they're obviously not.

Cheers, P-F

0

I had this problem when running it on IIS locally, and I attempted to go to Control Panel -> Region -> Administrative to copy the settings to new user accounts and the service accounts but it didn't seem to fix it for the ApplicationPoolIdentity. This article helped fix the problem:

http://blogs.microsoft.co.il/idof/2010/08/05/different-culture-settings-between-iis-and-aspnets-development-server/

Here's the quick summary of the fix:

  1. Open regedit and export CURRENT_USER\Control Panel\International
  2. Edit the .reg file with the SID of a user under HKEY_USERS
  3. Import the .reg file
  4. Repeat 2 and 3 for each SID with the incorrect international settings.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .