Tuesday 5 January 2010

Custom Globalization issues in deployment





I thought I should start my first post with a recent problem i have encountered.

I had a web application that used a Custom Culture to change the text of certain fields on the pages for a specific customer. For this I created a custom culture and created separate resource files for the pages.

This all worked fine on my development machine but when deployed to the production server the site would not run wit the following error...

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0101: The namespace 'Resources' already contains a definition for 'Global'


This was caused because there was no custom culture on the server so both resources were being compiled into the same class.

After a bit of searching I found Microsoft Locale Builder this would have been perfect but unfortunately it only works on windows vista!? This gave me the idea of creating my own.

Below is the code listing for the form, it can be used to create a custom culture based on a previous culture on the system. Custom Cultures can also be removed.








1 comment: