.NET Framework 3.5 will fail to install if .NET Framework 3.0 beta is installed

A few customers have reported an issue when installing the .NET Framework 3.5 beta 1 or Visual Studio Orcas beta 1.  This particular failure occurs when trying to install one of the .NET Framework 3.0 service packs, which is chained as a part of .NET Framework 3.5 installation. 

Information about the error

The .NET Framework 3.5 setup log file (located at %temp%\dd_dotnetfx35install.txt) shows the following error message:

[05/01/07,04:44:44] Microsoft .NET Framework 3.0SP1 WCF: ***ERRORLOG EVENT*** : Error code 1642 for this component means "The upgrade patch cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade patch may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade patch."

Windows Installer error code 1642 means that the base product that the service pack applies to is not actually installed on the system.  In the cases we've seen of this error so far, the system had a beta version of the .NET Framework 3.0 installed.  The .NET Framework 3.0 service packs do not apply to beta versions of the .NET Framework 3.0.

How to resolve the error

If you run into this scenario on your system, you can resolve it by uninstalling the beta version of the .NET Framework 3.0 from the Add/Remove Programs control panel on your system and then re-running .NET Framework 3.5 beta 1 or Visual Studio Orcas beta 1 setup.

A note about the root cause of this error

The underlying problem here is that the .NET Framework 3.5 uses the following registry value to determine whether or not it needs to install the .NET Framework 3.0:

[HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v3.0\Setup]
InstallSuccess=1

Unfortunately, as I described in this blog post, that InstallSuccess registry value is set in both the beta versions of the .NET Framework 3.0 and the final release.  That means that the .NET Framework 3.5 setup does not currently distinguish between the 3.0 beta and the 3.0 final release when deciding whether or not to install the .NET Framework 3.0 during 3.5 setup.  This will likely be fixed in the future by adding a block to .NET Framework 3.5 setup so it will not install if a beta version of the .NET Framework 3.0 is still installed on the system, but in the meantime you will have to manually uninstall the .NET Framework 3.0 beta if you run into an error like this.