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:
.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.
Comments
Anonymous
July 14, 2010
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 . . .Anonymous
August 25, 2010
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!!Anonymous
January 08, 2011
You are the best of the best, I spent about 3 days troubleshooting this problem. So, I finally get it fix, thank you.Anonymous
January 15, 2011
after months of having various programs crashes, i've finally managed to overcome this issue! thanks a million!Anonymous
March 08, 2011
This posting was soooooooooooo helpful. Thanks a million.Anonymous
March 22, 2011
It worked like magic, thanks.Anonymous
April 20, 2011
Excellent post. Worked as advertised!Anonymous
April 25, 2011
Thank you very much! Your post saved my time and nerves!Anonymous
July 06, 2011
Thank you very much for your help and your knowledge.Anonymous
March 14, 2012
Finally! found your easy and valid solution for my .NET Framework 2.0 SP2 error. Thank you very much!!Anonymous
August 30, 2012
Very useful blog posst.Anonymous
October 24, 2012
The comment has been removedAnonymous
October 25, 2012
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.Anonymous
January 24, 2013
Thank you so much for this! For several hours I have tried other stuff to fix my Net Frameweork ---> only yours worked :)Anonymous
April 22, 2013
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..Anonymous
April 23, 2013
Hi Tomy - I'd suggest first trying the repair tool described at blogs.msdn.com/.../10359320.aspx. If that doesn't work, then I'd suggest trying the manual uninstall steps described at blogs.msdn.com/.../487096.aspx. Hopefully one of these will help in this scenario.Anonymous
May 03, 2013
I really appreciate the info above, but do I enter this in a com prompt?Anonymous
May 03, 2013
Hi betty lynn - Yes, you can run these commands from a cmd prompt.Anonymous
September 16, 2013
Congratulations !!! Bravo again and again for sharing this. So usefull. Nothing else worked, and this fixed everything. This should be no 1 in search for corrupted net framework problem solution. thank youAnonymous
December 09, 2013
Simply amazing!Anonymous
December 28, 2013
You are a savior really ! Have been struggling since morning and finally found your blog that got rid of the problem (Just like that !!!). Thank you very much for the advice.Anonymous
February 20, 2014
Really good, applied on my server and tada, back to operations! thank you, regards, TomolimoAnonymous
March 13, 2014
The comment has been removedAnonymous
March 13, 2014
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.Anonymous
July 10, 2014
there is no success for me, - Installer says that this command only valid for already installed products... may be problem is in the language? I am using Dutch version of Win XP . or something with the "spaces" in the command? is there space between second and third row?Anonymous
July 11, 2014
The comment has been removedAnonymous
July 20, 2014
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?Anonymous
July 21, 2014
Hi Andrei H. - Here are the steps that I suggest for this type of error:
- Install the latest Windows service pack if you haven't yet.
- Try to run the System Update Readiness Tool from support.microsoft.com/.../947821.
- Try to repair the files that are a part of your OS by using the steps listed at blogs.msdn.com/.../how-to-repair-the-net-framework-2-0-and-3-0-on-windows-vista.aspx. If none of the above help, you might need to repair/re-install Windows to fix this type of error.
- Anonymous
December 23, 2014
Just wanted to say thank you, this took care of my .Net issues on a 2003 Server which was failing multiple .Net patches from WSUS. Appreciate it!