Repairing the .NET Framework 2.0 SP2 or 3.0 SP2 MSI from Add/Remove Programs does not work

Last week, I posted a set of command line parameters that can be used to repair or uninstall the .NET Framework 2.0 SP2 and 3.0 SP2. When I was working on that blog post, I noticed a behavior change that is new in 2.0 SP2 setup and 3.0 SP2 setup that affects the repair scenarios for these products on Windows XP and Windows Server 2003, so I wanted to describe the issue and how to work around it.

Description of the issue

There was a change made in the MSI-based installers for the .NET Framework 2.0 SP2 and 3.0 SP2 that causes the default repair that happens when you use the Add/Remove Programs entry for these products to not actually repair anything. For example, if you end up with an out-of-date version of c:\windows\system32\mscoree.dll or if any of the files or registry values in the .NET Framework 2.0 SP2 or 3.0 SP2 are missing entirely, the repair from Add/Remove Programs will not restore the files or registry keys.

Because this issue only affects the MSI-based installers for 2.0 SP2 and 3.0 SP2, you will only encounter this issue on Windows XP and Windows Server 2003. On Windows Vista and Windows Server 2008, the .NET Framework 2.0 SP2 and 3.0 SP2 are installed as OS update packages instead of as MSIs.

How to work around the issue

If you need to repair the MSI-based version of the .NET Framework 2.0 SP2 or 3.0 SP2 on Windows XP or Windows Server 2003, you must run the following command lines instead of using the repair option from Add/Remove Programs:

The reason that these command lines need to be different (aside from the product codes changing between SP1 and SP2) is that the REINSTALL=ALL property no longer gets set by default in the MSI-based .NET Framework 2.0 SP2 or 3.0 SP2 repair processes. There is a custom action in .NET Framework 2.0 SP1, 2.0 SP2, 3.0 SP1 and 3.0 SP2 setup that sets the REINSTALL=ALL property during repair scenarios. However, the condition for that custom action was changed in 2.0 SP2 and 3.0 SP2 setup such that it will never evaluate to true, and the REINSTALL=ALL property no longer gets automatically set. As a result, you have to manually pass in the REINSTALL=ALL property in order to perform a full repair of the .NET Framework 2.0 SP2 and 3.0 SP2.

Thank you for this posting. I had spent several hours trying to repair/uninstall/re-install .Net Framework 2.0 but was getting nowhere. The information you provided for the '.NET Framework 2.0 SP2 – silent repair' for Windows XP worked perfectly.

It is interesting to note that my .NET Framework 2.0 SP2 became corrupt after installing a Microsoft Update . . .

You are my new Online Hero.. Spent 2 days troubleshooting a users problem in scotland over VPN trying to resolve this.. then had the laptop sent back and ran this one command and it fixed it.. Wish i'd found this post sooner!!

Hi SyN Lambo – I'm sorry, but I'm not sure what would be causing that error when you try to run your game. I'd suggest searching on the web site for the manufacturer of the game to see if they have any FAQs or troubleshooting steps that you can try. They might also have a technical support team that you can contact for further assistance.

Hello, I tried that. But, an error happened :" This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package", my PC is Windows XP with Windows Installer 4.0, help me please!, sorry if there is mistake for my English here..

Hi MBM – I can't tell from that event log information whether this is a problem with the .NET Framework or a problem with the application itself. To try to narrow this down, I'd suggest using the steps and tools listed at blogs.msdn.com/…/8108332.aspx to remove the versions of the .NET Framework that are currently installed on your computer and then re-install the .NET Framework 3.5 SP1.

Hello, got a question… we're running in a business environment and use an application developed with .net that is some sort of computer manager, all in one center for programs, downloads and the such. The issue is that, for a limited number of clients, mostly those that relay heavily on Visual Studio, their .Net 2.0 that comes with Windows 7 gets broken and hence the Performance Profiler from VS prompts the user every minute or so that the custom application has crashed. Question is, how can we repair the built in .net version from windows 7?