Aaron Stebner's WebLog

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

How to manually cleanup a failed .NET Framework 2.0 install

How to manually cleanup a failed .NET Framework 2.0 install

Rate This

In response to the blog article I posted last week where I provided a link to a .NET Framework manual cleanup tool, I got some questions about whether or not a comparable version is available for cleaning up the .NET Framework 2.0.  I am currently working on a couple of small work items in the code for the tool to enable it to work with 2.0, but in the meantime I wanted to post some manual steps.  I know there have been a lot of uninstall/reinstall issues because we have released an alpha, a beta and numerous Community Tech Preview (CTP) versions and not all of them will uninstall completely cleanly in order to allow a future beta version of 2.0 to install correctly.

 

The following steps will help resolve .NET Framework 2.0 installation failures/hangs in most cases. Before proceeding please note these important caveats:

  • These steps will only work for the .NET Framework 2.0 installed by dotnetfx.exe (the MSI-based setup).  There is a version of .NET Framework 2.0 that is installed as part of the OS if you are running any pre-release builds of Windows codename Longhorn.  You should not use these steps on Longhorn.
  • These steps will damage the .NET Framework 1.0 or 1.1 if you have either of these versions installed on your computer.  This is because you are instructed to rename the file mscoree.dll that is shared by all versions of the .NET Framework.   If you have 1.0 or 1.1 installed, you will need to immediately install a later build of .NET Framework 2.0 to update mscoree.dll or perform a repair of the .NET Framework 1.0 or 1.1.  To repair .NET Framework 1.0 or 1.1, go to the Add or Remove Programs control panel, click on the link for support information, and then click on the Readme link.
  • If you are running Windows Server 2003, Windows XP Media Center Edition or Windows XP Tablet PC Edition, there is a version of the .NET Framework that ships as part of the OS.  In those situations, you cannot repair by using the instructions in Add or Remove Programs under the readme link.  In those scenarios it is strongly recommended that you immediately install .NET Framework 2.0 to provide an updated version of mscoree.dll.  If that is not an option, you must repair your OS to fix the issue.

Steps to clean up a machine to fix a failed .NET Framework 2.0 installation:

  • Using Add or Remove Programs, locate any versions of the .NET Framework 1.2 or 2.0 and choose Remove to uninstall them
  • Using regedit, navigate to HKLM\Software\Microsoft\.NETFramework and delete any keys and values that have 1.2 or 2.0 in it, including keys/values that are in subkeys underneath .NETFramework.
  • Using regedit, navigate to the sub-hive HKLM\Software\Microsoft\.NETFramework\Policy and delete any key or value that has 1.2 or 2.0 in it. 
  • Using regedit, navigate to HKLM\Software\Microsoft\ASP.NET and delete any key or value that has 1.2 or 2.0 in it, including keys/values that are in subkeys underneath ASP.NET. 
  •  Right-click on My Computer and choose Manage. Expand Computer Management (Local), then Local Users and Groups, then click on the Users folder. In the right-hand pane, right-click on the ASPNET user account and choose Delete to remove it.
  •  Go to %windir%\assembly and delete anything with *1.2* or *2.0* in the folder name. Delete the GAC_32 and GAC_MSIL folders as well.

    You can not view the contents of %windir%\assembly in Windows Explorer when the .NET Framework is installed.  In order to view the contents, you will need to set the following registry value and reopen Windows Explorer

    Key name:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
    Value name: DisableCacheViewer
    Data type: REG_DWORD
    Value data: 1

    Note: You should remove the DisableCacheViewer value after you complete this step because this is only used for debugging purposes.

  • Go to %windir%\Microsoft.NET\Framework and delete any folders named v1.2.* or v2.0.* along with all of the files and subfolders they contain.  You may get errors when trying to delete some of the files because they are in use.  In most cases, rebooting the machine and trying again will work.  If not, you can rename the files to be <filename>.old and then delete them after a future reboot.
  •  Rename %windir%\system32\mscoree.dll to mscoree.dll.old.
  •  After doing all of this, try to install the previously failing version of the .NET Framework 2.0.

If you have any trouble getting these steps to work correctly please let me know.  Also stay tuned for a future post once I get the cleanup tool updated to work with .NET Framework 2.0 and post it for download.

 

  • Dear Aaron,

    I have bump into the following issue when installing .NET Framework v2.0 from the VS 2005 CD (netfx version): whenever I install it, I get a crash while
    '
    Registering System.EnterpriseServices.dll
    Executing: "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegSvcs.exe" /bootstrapi
    '.

    This is the whole history of VS 2005 and this computer:
    1. VS 2005 Beta 2 instlled & uninstalled with no issues.
    2. VS 2005 RC installed & uninstalled with no issues.
    3. VS 2005 RTM installed with no issues.
    4. VS 2005 starting to fail loading components, as well as vshost.exe crashes. I followed the instructions in your blog regarding how to remove it. Framework started to crash upon uninstall as well as the SQL Server 2005 Mobile component.
    5. I followed your cleanup instructions, which did not help with regards to how to clean up the environment.
    6. I followed the specific instructions regarding how to clean Framework 2.0, but this still doesn't help.
    7. I tried to run "gacutil /i System.EnterpriseServices.dll" as you adviced someone else with a similar situation on Beta 2, but this worked fine and did not crash.

    This, of course, entirely prevents me from installing VS 2005...

    Please advise! I am entirely helpless. Reinstalling the machine is a complicated issue.

    TIA, Nadav
  • Hi Matt - the .NET Framework 2.0 is designed to work side-by-side with .NET 1.0 and 1.1. It sounds like you may have run into an issue that was a bug in one of the beta versions of the .NET Framework 2.0 but has been fixed in the final release. I encourage you to try to install the final release of the .NET Framework 2.0 from http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&DisplayLang=en and not be deterred by the previous problems you've run into. If you hit any future issues, please contact me directly using http://blogs.msdn.com/astebner/contact.aspx and I will do my best to assist.

    Hi Nadav - I posted a blog entry yesterday that may help solve this issue for you with the .NET Framework 2.0 final release. Can you please try the workarounds listed at http://blogs.msdn.com/astebner/archive/2006/01/08/510677.aspx and see if it helps solve this issue for you?
  • Hello Aaron,

    Thsnks for your reply!

    I tried the workarounds, they did not help. But I did look at the installation log files, and found this right after the crash, which may finally lead to some clue:

    Unhandled Exception:
    System.IO.FileLoadException: Could not load file or assembly 'RegSvcs, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)
    File name: 'RegSvcs, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' ---> System.Security.Policy.PolicyException: Execution permission cannot be acquired.
    at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission)
    at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission)

    I still have the files (and they're not that difficult to reproduce regardless), so I can post them to you or to Product Feedback Center as you advise.

    Again TIA,
    Nadav
  • Your 1.0/1.1 cleanup tool proved to be very useful when trying to get a Linksys WMA11B up and running on an XP machine with 1.0, 1.1 and 2.0 previously installed. This product seems to XP SP2 and .NET since 1.0!
  • Hi Nadav - I have not seen a crash like you are reporting in the past. Could you please zip and send me the file dd_netfx20msi*.txt from this system so I could take a look? You can send it to aaronste@microsoft.com.
  • Hello Aaron,

    I finally managed to install the framework and VS 2005. I took the following steps to clean old installations:

    First, I deleted C:\Documents and Settings\%User%\Application Data\Microsoft\CLR Sec
    urity Config\v2.0.* (and there were 3 different ones, one for Beta2, one for RC and one for final version).

    Second, I looked through the registry for all the keys/values that contained 50215 or 50727 and deleted them (carefully, of course - sometimes only parts of them).

    Afterwards VS installation came out clean. For now it seems to be working well.

    Regards,
    Nadav
  • Hi Nadav - I am very happy to hear that you were able to figure this out. I'm sorry for the hassle that you encountered while trying to get it to work and also for the delay in getting back to you after you sent the log files to me. I had been trying to reproduce the issue to figure out other possible suggestions to send you but hadn't had any luck.

  • Thanks for this, I finally managed to get .NET v2.0 to install after deleting everything. The error I was getting wasn't one I've seen anywhere else, so I'll post it here in case anyone else has the same problem:
    Error 25015.Failed to install assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Build.Engine.dll' because of system error: The system cannot find the path specified.
  • Quick question... I don't have the beta uninstaller anymore. Is it mandatory? I know it's needed to run the programs given online and on the add/remove tool, but is there a manual way to remove this successfully before I try. I cannot find a beta version to download. If needed, can anyone find and/or supply a version to install so that I can finally uninstall my vb.net express 2005 and webforms webapps (forgot exact name) 2005...beta 2. Thanks in advance!
  • Hi Jmonkey - The beta uninstaller makes things easier, but it isn't necessarily mandatory.  In the steps to remove the beta version listed at the top of this blog post, you can replace the first bullet ("Using Add or Remove Programs, locate any versions of the .NET Framework 1.2 or 2.0 and choose Remove to uninstall them") with the steps listed at http://blogs.msdn.com/astebner/archive/2005/10/30/487096.aspx and that should allow you to achieve the same results.  Hope this helps!
  • I was attempting to install Visual Basic Studio Express Edition.
    It said something about uninstalling several apps and the .NET Framework 2.0 beta prior to install.
    I mistakenly uninstalled the .NET Framework before uninstalling the other apps. SQL Server 2005 Express Edition Beta 2
    SQL Server 205 Tools Express Edition Beta 2
    SQL Server Setup Support Files
    MSDN Express Library 2005 Beta - English
    I'm not sure that I must remove the MSDN Express Library.  Anyhow, I have download and attempted to install dotnetfx.exe it fails and crashes asking to send a report which I have done.
    I tried the following cleanup tool: http://astebner.sts.winisp.net/Tools/netfx20_beta2.zip
    And attempted again to install, it failed.  I'm unable the apps until I have 2.0 reinstalled.
    Any help will be appreciated.
  • I made problems worse before I made them better.
    I previously had a FAT32 partition for my Primary drive, I converted it to NTFS and began a tedious process of manually setting security for many of the key folders. I used a properly installed version of Windows XP as a guide.  Some subfolders may still be set wrong.  SYSTEM didn't have access to my temp folder.  This prevented my reinstallation of .NET 1.0 and 1.1 Frameworks.  I expect I may be able to install the 2.0 framework as well now.   (Fingers crossed)
  • Yeah, that fixed it.  I know have 2.0 back in, I should be able to accomplish my tasks, I won't post anymore unless I run into more problems.
  • My attempts at uninstalling:
    SQL Server 2005 Express Edition Beta 2
    SQL Server 205 Tools Express Edition Beta 2
    are met with the following message:
    The Microsoft .Net Framework 2.0 is not installed. Please install before running setup.
    I have installed, I have attempted the clean, I have attempted reinstall. Both of these install times appear to be successful.  I did reboot after the first install, and rebooted after the second install.  My process of cleaning the 2.0 install included the steps noted at the very top this page Titled, "Steps to clean up a machine to fix a failed .NET Framework 2.0 installation:" These include some minor registry changes and folder deletions.

    As stated before, any help is greatly appreciated
  • Hi Lucius - Can you please try to use the steps listed at http://blogs.msdn.com/astebner/archive/2005/10/30/487096.aspx to locate and manually remove the SQL 2005 beta versions that are still installed on your system and see if that solves this issue for you?
Page 4 of 9 (134 items) «23456»
Leave a Comment
  • Please add 5 and 6 and type the answer here:
  • Post