Thursday, August 9, 2007

P2V, SSIS, asp.net and datetime

Recently I did a P2V of a production Windows 2003 server in order to create a dev environment.

Among other things it comprises an asp.net site that calls an SSIS package.

When I attempted to debug the existing SSIS package in visual studio, it failed with "string was not recognized as a valid datetime". When I checked the regional settings of the windows server I found they had not survived the P2V process and had reverted to US english. This post discusses the language translation issues that can occur with SQL Server, so as per previous blog post I updated the windows default regional settings. I left SQL Server as us_english as this is how it's set up in prod.

End to end debugging was fine after this. However when I deployed assemblies into the dev environment but I got exactly the same error at the point of calling the SSIS package from asp.net. Suspicion immediately fell on the app pool identity. However its database user has the same default language as all the other users - us_english.

I then noticed that Sharepoint on the same box was displaying US style dates. So it appeared that IIS or asp.net had a different default locale from windows! But no, updating the Sharepoint locale info didn't fix the asp.net site. It turns out that Sharepoint sites have their own locale info which is drawn from Sharepoint's own settings.

I decided to repair IIS but found that I couldn't get to Add/Remove Windows Components from the Add or Remove Programs control panel - I got an error as follows:

Setup library ocgen.dll could not be loaded, or OcOMEntry could not be found. Contact your system administrator. The specific error code is 0x7F.

Presumably this was another P2V side effect. I ran sfc /scannow but this didn't help.

Giving up on this, I went back to investigate the site's asp.net global configuration and noticed that the application settings had dates stored in the local format! So the translation was happening on the site itself. On the application tab I found that the culture and UI culture had changed to af-ZA (Afrikaans). Actually I suspected the values were blank and the dropdowns were just displaying the first entries on the lists. So I updated them to local culture and reset iis. The sites were now using local dates.

No comments: