Aaron Stebner's WebLog

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

.NET Framework Cleanup Tool User's Guide

.NET Framework Cleanup Tool User's Guide

Rate This

.NET Framework Cleanup Tool User's Guide

Introduction

This .NET Framework cleanup tool is designed to automatically perform a set of steps to remove selected versions of the .NET Framework from a computer.  It will remove files, directories, registry keys and values and Windows Installer product registration information for the .NET Framework.  The tool is intended primarily to return your system to a known (relatively clean) state in case you are encountering .NET Framework installation, uninstallation, repair or patching errors so that you can try to install again.

There are a couple of very important caveats that you should review before using this tool to remove any version of the .NET Framework from your system:

  • This tool is designed as a last resort for cases where install, uninstall, repair or patch installation did not succeed for unusual reasons.  It is not a substitute for the standard uninstall procedure.  You should try the .NET Framework Repair Tool and then try the steps listed in this blog post before using this cleanup tool.
  • This cleanup tool will delete shared files and registry keys used by other versions of the .NET Framework.  If you run the cleanup tool, you will need to perform a repair/re-install for all other versions of the .NET Framework that are on your computer or they will not work correctly afterwards.
  • Additional support can be obtained by visiting the .NET Framework setup forum at http://social.msdn.microsoft.com/Forums/en-US/netfxsetup/threads.

Download location

The .NET Framework cleanup tool is available for download at the following locations:

The .zip file that contains the tool also contains a file named history.txt that lists when the most recent version of the tool was published and what changes have been made to the tool over time.

Supported products

The .NET Framework cleanup tool supports removing the following products:

  • .NET Framework - All Versions
  • .NET Framework - All Versions (Tablet PC and Media Center)
  • .NET Framework - All Versions (Windows Server 2003)
  • .NET Framework - All Versions (Windows Vista and Windows Server 2008)
  • .NET Framework - All Versions (Windows 7)
  • .NET Framework 1.0
  • .NET Framework 1.1
  • .NET Framework 2.0
  • .NET Framework 3.0
  • .NET Framework 3.5
  • .NET Framework 4
  • .NET Framework 4.5
  • .NET Framework 4.5.1
  • .NET Framework 4.5.2

Not all of the above products will appear in the UI for the .NET Framework cleanup tool on every operating system.  The cleanup tool contains logic so that if it is run on an OS version that includes the .NET Framework as an OS component, it will not offer the option to clean it up.  This means that running the cleanup tool on Windows XP Media Center Edition or Tablet PC Edition will not offer the option to clean up the .NET Framework 1.0, running it on Windows Server 2003 will not offer the option to clean up the .NET Framework 1.1 and running it on Windows Vista or Windows Server 2008 will not offer the option to clean up the .NET Framework 2.0 or the .NET Framework 3.0.

When choosing to remove any of the above versions of the .NET Framework, the cleanup tool will also remove any associated hotfixes and service packs.  You do not need to run any separate steps to remove the service pack(s) for a version of the .NET Framework.

Silent installation mode

The .NET Framework cleanup tool supports running in silent mode.  In this mode, the tool will run without showing any UI, and the user must pass in a version of the .NET Framework to remove as a command line parameter.  To run the cleanup tool in silent mode, you need to download the cleanup tool, extract the file cleanup_tool.exe from the zip file, and then run it using syntax like the following:

cleanup_tool.exe /q:a /c:"cleanup.exe /p <name of product to remove>"

The value that you pass with the /p switch to replace <name of product to remove> in this example must exactly match one of the products listed in the Supported products section above.  For example, if you would like to run the cleanup tool in silent mode and remove the .NET Framework 1.1, you would use a command line like the following:

cleanup_tool.exe /q:a /c:"cleanup.exe /p .NET Framework 1.1"

One important note – as indicated above, the cleanup tool will not allow you to remove a version of the .NET Framework that is installed as part of the OS it is running on.  That means that even if you try this example command line on Windows Server 2003, the tool will exit with a failure return code and not allow you to remove the .NET Framework 1.1 because it is a part of that OS.

Similarly, you cannot use the cleanup tool to remove the .NET Framework 1.0 from Windows XP Media Center Edition or Windows XP Tablet PC Edition or remove the .NET Framework 2.0 or 3.0 from Windows Vista or Windows Server 2008.  In addition, if you run the cleanup tool on an OS that has any edition of the .NET Framework installed as a part of the OS, it will prevent you from using the .NET Framework - All Versions option because there is at least one version that it cannot remove.

If you are planning to run the cleanup tool in silent mode, you need to make sure to detect what OS it is running on and not pass in a version of the .NET Framework with the /p switch that is a part of the OS or make sure that you know how to handle the failure exit code that you will get back from the cleanup tool in that type of scenario.

Unattended installation mode

The .NET Framework cleanup tool supports running in silent mode.  In this mode, the tool will run and only show a progress dialog during removal, but will require no user interaction.  Unattended mode requires the user to pass in a version of the .NET Framework to remove as a command line parameter.  To run the cleanup tool in unattended mode, you need to download the cleanup tool, extract the file cleanup_tool.exe from the zip file, and then run it using syntax like the following:

cleanup_tool.exe /q:a /c:"cleanup.exe /p <name of product to remove> /u"

For example, if you would like to run the cleanup tool in unattended mode and remove the .NET Framework 1.1, you would use a command line like the following:

cleanup_tool.exe /q:a /c:"cleanup.exe /p .NET Framework 1.1 /u" 

Exit codes

The cleanup tool can returns the following exit codes:

  • 0 - cleanup completed successfully for the specified product
  • 3010 - cleanup completed successfully for the specified product and a reboot is required to complete the cleanup process
  • 1 - cleanup tool requires administrative privileges on the machine
  • 2 - the required file cleanup.ini was not found in the same path as cleanup.exe
  • 3 - a product name was passed in that cannot be removed because it is a part of the OS on the system that the cleanup tool is running on
  • 4 - a product name was passed in that does not exist in cleanup.ini
  • 100 - cleanup was able to start but failed during the cleanup process
  • 1602 - cleanup was cancelled

Log files

The cleanup tool creates the following log files:

  • %temp%\cleanup_main.log - a log of all activity during each run of the cleanup tool; this is a superset of the logs listed below as well as some additional information
  • %temp%\cleanup_actions.log - a log of actions taken during removal of each product; it will list files that it finds and removes, product codes it tries to remove, registry entries it tries to remove, etc.
  • %temp%\cleanup_errors.log - a log of errors and warnings encountered during each run of the cleanup tool

 

Attachment: dotnetfx_cleanup_tool.zip
  • Hi A Dutch Man - I'm sorry for the hassles you're running into.  What exact errors are you seeing, and what versions of the .NET Framework are you seeing them with?  Can you please use the tool described at blogs.msdn.com/.../6458047.aspx to gather your .NET Framework log files, upload the file named %temp%\vslogs.cab that this tool produces to a file server (such as http://skydrive.live.com) and then reply back here with a link that I can use to download your log files and take a further look?

  • I have a Windows 7 64 bit computer that I need to downgrade the framework to version 2, before the service packs.  We run Microsoft Dynamics and in order for the install to run properly that is the version you have to have on your machine.  I see from the post above that I can not remove version 3.5.  I ran your utility and I also have the box unchecked in the Windows features.  Anyway that I can install version 2?  I tried and it says a version is already installed on the machine?  Thanks

  • Hi Ktcoleman - Windows 7 includes the .NET Framework 3.5 SP1 as a part of the OS, and that in turn includes the .NET Framework 3.0 SP2 and 2.0 SP2.  You can uncheck the item named Microsoft .NET Framework 3.5.1 in the Windows Features control panel, but that will only hide 3.0 SP2 and 3.5 SP1.  You cannot remove or hide the .NET Framework 2.0 SP2 on this OS.  However, any application that requires the .NET Framework 2.0 should work fine with 2.0 SP2 on the system instead.  Does the installer give you some kind of error in this scenario?

  • This worked. Thanks!!!

    I first uninstalled all .net versions manually using add/remove programs. Then I used this tool. It worked - Windows is no longer confused.

  • I tried downloading the clean-up tool zip file to my desktop, but every time I try to open it, the computer goes crazy and keeps opening up new boxes with Windows Explorer 8 and I have to shut everything down to stop the chaos.  What am I doing wrong?  I have an HP m8020n Pavillion Media Center and am running Vista Home Premium Service Pack 2.  Thanks for your guidance; I am a relative novice to all this.

  • Hi Gary - I haven’t heard of this type of problem before.  Does this start happening when you try to double-click the zip file to extract it?  Do you have another computer you could use to try to extract the zip file instead?  If not, can you please contact me by using the form at blogs.msdn.com/.../contact.aspx and I can try to email you a copy of the tool instead?

  • Hi Aaron - Haven't received the e-mail with the .Net Removal Tool yet; I don't know why I can't double-click the file on my desktop without explorer going nuts and opening 10,000 boxes.  Tried disabling Norton and turning off pop-up blocker but still having the same trouble.  Looking forward to receiving your e-mail soon.  Thanks much.

  • Hi Gary Paller - I sent you a mail yesterday with a copy of the tool attached.  I also just resent it.  Please check your junk mail folder in case it is getting filtered out by your mail server.

  • Thank you so much for the cleanup tool, it have been very helpfully :)

  • hi astebner, when i tried to download from the link you provided me it says the zip file is corrupt. Can you send me the software to my email it is jamesanse@gmail.com i am in need of it urgently.  Thx

  • Hi Jamesss - Did you try to use both of the download links?  They are both working fine for me, so I'm not sure why you would be seeing this type of error.  I can try to email you a copy as well, but I will just be emailing the same thing that is linked in this user's guide, so I'm not sure that will give you any better results.  Do you have any other computer you could try to download and extract this zip file on in the meantime just in case this is being caused by something on your computer?

  • Thank you so much. Though I was in a real jam but .Net Framework Cleanup Tool solved it. I cannot thank you enough.

  • how come we have dot net 4 and still we need this tool to uninstall&re-install dot net?

    every month or so, when i have a new update to dot net, it fails and i have to uninstall anything related to dot net by using the normal method (add/remove programs) ,using this tool and using the installer cleanup tool of Microsoft.

    why can't the new dot net simply replace all of the previous versions and stop failing the update of itself?

    these problems exist from the first time i used dot net (version 1) , and we have now version 4...

    how could this be?

    btw, i'm using (legal) windows xp sp3 32bit home edition.

    when there is a new version of java , we simply install on top, or uninstall the older version and install the new one. why can't the same thing work for dot net? for every tiny update/patch, create a new build number which everyone can use , and simply replace the older version.

    since Microsoft is the owner of Windows, it shouldn't be hard to master the way installations work on this platform.

  • Hi Frustrated User - I'm sorry for the hassles and frustrations that these issues end up causing.  The versions of the .NET Framework are designed to install and run side-by-side, which is why each new version doesn't replace previous versions.  Unfortunately, there are some bugs in previous versions of the .NET Framework that can cause issues installing updates for those versions.  Fortunately, each new version contains fixes for issues found in previous releases, and in particular the 4.0 version has been significantly more reliable, even during the beta versions.  I anticipate that there will be many fewer issues once updates start to be released for the .NET Framework 4.  I realize however that this isn't much consolation to you as you continue to deal with issues patching previous versions of the .NET Framework, and I'm sorry for that.

  • Hi Frustrated User - I'm sorry for the hassles and frustrations that these issues end up causing.  The versions of the .NET Framework are designed to install and run side-by-side, which is why each new version doesn't replace previous versions.  Unfortunately, there are some bugs in previous versions of the .NET Framework that can cause issues installing updates for those versions.  Fortunately, each new version contains fixes for issues found in previous releases, and in particular the 4.0 version has been significantly more reliable, even during the beta versions.  I anticipate that there will be many fewer issues once updates start to be released for the .NET Framework 4.  I realize however that this isn't much consolation to you as you continue to deal with issues patching previous versions of the .NET Framework, and I'm sorry for that.

Page 6 of 35 (517 items) «45678»
Leave a Comment
  • Please add 2 and 4 and type the answer here:
  • Post