Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

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

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

Rate This
  • Comments 26

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:

.NET Framework 2.0 SP2 - silent repair

msiexec /fpecmsu {C09FB3CD-3D0C-3F2D-899A-6A1D67F2073F} REINSTALL=ALL /l*v %temp%\netfx20sp2_repair_log.txt /qb

.NET Framework 3.0 SP2 - silent repair

msiexec /fpecmsu {A3051CD0-2F64-3813-A88D-B8DCCDE8F8C7} REINSTALL=ALL /l*v %temp%\netfx30sp2_repair_log.txt /qb

Behind-the-scenes details if you are interested

There is a difference in the command line switches being passed in to trigger the repair of 2.0 SP2 and 3.0 SP2 compared to 2.0 SP1 and 3.0 SP1.  Here are a couple of specific examples:

.NET Framework 2.0 SP2 - silent repair

msiexec /fpecmsu {C09FB3CD-3D0C-3F2D-899A-6A1D67F2073F} REINSTALL=ALL /l*v %temp%\netfx20sp2_repair_log.txt /qn

.NET Framework 2.0 SP1 - silent repair

msiexec /i {B508B3F1-A24A-32C0-B310-85786919EF28} /l*v %temp%\netfx20sp1_repair_log.txt /qn

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!!

    Thanks Again!!

  • You are the best of the best, I spent about 3 days troubleshooting this problem. So, I finally get it fix, thank you.

  • after months of having various programs crashes, i've finally managed to overcome this issue!

    thanks a million!

  • This posting was soooooooooooo helpful. Thanks a million.

  • It worked like magic, thanks.

  • Excellent post. Worked as advertised!

  • Thank you very much! Your post saved my time and nerves!

  • Thank you very much for your help and your knowledge.

  • Finally! found your easy and valid solution for my .NET Framework 2.0 SP2 error.

    Thank you very much!!

  • Very useful blog posst.

  • WTF!!! For how many Years I battle for that problem, you are the only solution!! Thank you!!!

    Can You Help me about something.... I cant play my games because of an error: 0xc0000005 and i dont know why?? my graphics card updated, my RAM is doesn't have any bad sectors, and my drivers updated...

    Help me Please!! xD Comment if you know the solution!! Thanks!!!

  • 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.

  • Thank you so much for this! For several hours I have tried other stuff to fix my Net Frameweork ---> only yours worked :)

  • 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..

Page 1 of 2 (26 items) 12
Leave a Comment
  • Please add 4 and 3 and type the answer here:
  • Post