How can I repair .NET Framework 4.0 on Windows 8?

Joshua Frank picture Joshua Frank · Sep 20, 2013 · Viewed 8.9k times · Source

While trying debug my real problem, I'm trying to repair the .NET framework, because it looks like something in System.Data.SqlClient is hosed. But you can't uninstall this because it's part of the OS in Windows8, and you can't install it because it's already installed, and so I can't find any way to fix my problem. I suppose I could reinstall the whole OS, but that's way too painful.

Answer

magicandre1981 picture magicandre1981 · Sep 20, 2013

To Repair corrupted Windows files in Windows 8, open a command prompt with admin rights and run this DISM command:

DISM /Online /Cleanup-Image /RestoreHealth

This downloads the clean files and installs them correctly.