Discovered a fun little problem while working on an alleged hard drive failure, thought I would share:
When a computer running Windows Vista or 7 crashes with hard-drive failure (in this particular case due to a virus), the first step in the recovery console or in a system restore is to unregister the .NET 2.0 Framework. Apparently, itís a feature that is supposed to prevent .NET-enabled viral code from using the existing libraries. However, the unregister is faulty in the Vista/7 recovery console and trashes the mscorlibs dll, or at least damages it. When the dll is re-registered, itís in a broken state. Anything that depends on the 2.0 libraries, then, will fail to work. This includes Visual Studio 2008/2010, MS Powerpoint 2010, advanced parts of MS Word 2010 and MS Excel 2010 (such as data-driven pivot tables) and SQL Server 2008. What you see is a window stating that mscorlibs.dll or one of its dependencies failed to load.
As 2.0 and 3.5 are embedded in Windows 7 (and removing them would toast the OS entirely), itís not possible to reinstall them directly. Repair wonít work either, since the problem is that the OS thinks the damaged version of the dll is actually correct.
Click Start/All Programs/Accessories, right click on Command prompt and select ďRun as AdministratorĒ
At the command prompt type sfc /scannow
Wait about 20 minutes for the scan to complete.
You should see either that all problems are fixed or that the scan didnít find anything to do (this is actually a flaw in the reporting; it did find and correct the problem).
Reboot the computer. Everything should be working now.
For additional steps should the SFC fail, consult Jedi Master Aaron Stebner