Error installing .NET Framework on Windows XP SP2 caused by language settings

Note - the issue described in this blog post was originally presented as an issue on Windows XP SP2. However, it can also affect .NET Framework 1.0 and 1.1 installation on any OS released after the .NET Framework 1.0 and 1.1 shipped - specifically, I have seen reports of this issue on Windows Vista. The steps listed here are applicable to this type of install failure on other newer OS's like Windows Vista and not just Windows XP SP2.  

I was contacted by a customer last week who could not get the .NET Framework 1.1 to install correctly. It reported an error while registering System.EnterpriseServices.dll just like I describe in this post. In the end, the customer discovered that the system locale of the computer was set to Maltese, and he was able to install the .NET Framework by temporarily changing the system locale back to English.

I did a little research, and found that there is a bug in the .NET Framework that causes it to not work correctly when the default system locale is set to a language that the .NET Framework does not recognize. This bug has been fixed in the .NET Framework 1.0 SP3 and 1.1 SP1. However, this bug causes the initial installation of the .NET Framework to fail and rollback, and you cannot install the service pack without first getting the product installed (unless you use a method like I describe here, which will work but is not "officially" supported).

With the release of Windows XP SP2, Microsoft shipped Enabling Language Kits (ELKs) for 25 new locales (click here for a complete list and a nice description of what features ELKs provide). Because of the bug in the .NET Framework that I described above, if a computer running XP SP2 has the system locale set to one of these 25 new locales, installation of the .NET Framework will fail while trying to register System.EnterpriseServices.dll (which happens to be the first time that managed code gets run during setup and therefore is the first time the bug is hit).

If you are running into this bug on your Windows XP SP2 computer, you can use the following steps to work around this bug in the .NET Framework and get it installed:

  1. From the Start menu, type intl.cpl in the Run box or go to Control Panel and choose the Regional and Language Options item
  2. Click the Advanced tab
  3. Change the language in the dropdown box labeled "Select a language to match the language version of the non-Unicode programs you want to use:" to English (this setting represents the system locale for the computer)
  4. Check the box labeled "Apply all settings to the current user account and to the default user profile"
  5. Click OK
  6. Restart
  7. Install the .NET Framework 1.0 or 1.1
  8. Install .NET Framework 1.0 SP3 or 1.1 SP1
  9. Return to the Regional and Language Options control panel and change the language in the Advanced tab back to the original setting

For reference, here is what the Advanced tab of the Regional and Language Options control panel looks like. This screenshot is from my laptop, where I was able to reproduce the failure to install the .NET Framework by changing my system locale to Welsh (one of the 25 new ELKs included in XP SP2):
 

Regional and Language Options control panel Advanced tab

<update date="7/26/2005> As Michael Kaplan points out, the underlying bug affects both the .NET Framework core setup and the .NET Framework service pack setup. Once a computer has .NET Framework 1.0 + SP3 and/or 1.1 + SP1, the bug will not affect any future .NET Framework service packs. In addition, the bug can happen if your computer has a default user locale set to one of the new ELK languages, not just a default system locale. </update>

<update date="4/17/2008"> Added a note indicating that the issue in this post can affect the .NET Framework 1.0 and 1.1 setup on Windows Vista and not just Windows XP SP2 </update>