How to repair .NET framework 4 installation on Windows 8

07
2014-07
  • Igor Sevo

    My mscorlib.dll seems to be corrupt. I tried reinstalling from the standalone .NET 4 installation package, but .NET 4 is integrated into Windows 8.1. Is there a way to repair it?

    I have tried System Restore and sfc. They did not work.

    I know I can reinstall the system, but I would like a less painful solution.

  • Answers
  • QMechanic73

    To repair use the following command at a command prompt (with privileges)

    DISM /Online /Cleanup-Image /RestoreHealth
    

    RestoreHealth: This switch option checks for component store corruption, records the corruption to the log file, and FIXES the image corruption using Windows Update. This should take around 10-15 minutes up to about an hour to finish depending on the level of corruption.

    Source

  • Igor Sevo

    I manually copied the corrupt file from a different computer with the same Windows installation. It took some permission changing, but I managed to replace the file.


  • Related Question

    .Net Framework 3.5 SP1 on Windows 7 not recognized by installers
  • Christoph Rüegg

    Windows 7 Ultimate RTM already comes with the .Net Framework 3.5 SP1 preinstalled. However, some installers like the Azure tools and SDK 1.1 seem to check for it and fail:

    Windows Azure Tools for Microsoft Visual Studio requires .NET Framework 3.5 SP1.

    Since the framework is preinstalled there seems to be no way to reinstall or repair it (see also).

    Installed:

    • VisualStudio 2008 SP (9.0.30729.1)
    • VisualStudio 2010 RC (previosly beta)
    • Windows\Microsoft.NET\Framework contains folders for all 1.0, 1.1, 2.0, 3.0, 3.5, 4.0

    Any ideas on how to make the installers recognize the 3.5SP1 framework (without reinstalling the OS), or maybe to somehow reinstall it


  • Related Answers
  • Snark

    As described here:

    The promlem has been fixed after HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\SP was set to 1.

    More info here too (linked in the page above):

    Also could you check the following two registry keys and let me know what the values are?

    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v3.5\SP
    

    And

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\SP
    

    To get pass the install error, if the value of the registry is 0, set it to 1.

  • Christoph Rüegg

    What solved the problem for me:

    1. Control Panel > Programs > Turn Windows features on or off
    2. Uninstall "Microsoft .NET Framework 3.5.1" (and child nodes)
    3. Install "Microsoft .NET framework 3.5.1" (and child nodes)
    4. Reboot
    5. Installers (at least the Azure ones) now recognize 3.5SP1 again