{"id":142,"date":"2012-07-21T20:55:46","date_gmt":"2012-07-22T01:55:46","guid":{"rendered":"http:\/\/triplescomputers.com\/blog\/?p=142"},"modified":"2012-07-29T21:54:34","modified_gmt":"2012-07-30T02:54:34","slug":"repairing-the-net-framework-in-windows-vista7","status":"publish","type":"post","link":"https:\/\/www.triplescomputers.com\/blog\/casestudies\/repairing-the-net-framework-in-windows-vista7\/","title":{"rendered":"Repairing the .NET Framework in Windows Vista\/7"},"content":{"rendered":"<p>These days I do a considerable amount of data recovery for my clients, and as you might expect, when dealing with failing drives, it isn&#8217;t always possible to recover all of the information. \u00a0Even the <a title=\"DeepSpar\" href=\"http:\/\/deepspar.com\/\" target=\"_blank\">sophisticated hardware-based imaging tools<\/a> I have can&#8217;t always extract every sector from a bad drive.<\/p>\n<p>As such, I recently imaged a Windows 7 hard drive and retrieved something above 99% of the data. \u00a0This left very few files corrupt (and Windows was bootable following a\u00a0<strong>chkdsk \/f\u00a0<\/strong>operation), but one item which was not working properly was the .NET Framework. \u00a0Problem is, unlike in previous versions of Windows, repairing the .NET Framework in Windows 7 isn&#8217;t as simple as removing\/repairing all of the .NET Frameworks (either <a title=\"How to repair .NET Framework\" href=\"http:\/\/blogs.msdn.com\/b\/astebner\/archive\/2008\/03\/07\/8108332.aspx\" target=\"_blank\">via Add\/Remove Programs<\/a> or <a title=\"The .NET Framework Cleanup Tool\" href=\"http:\/\/blogs.msdn.com\/b\/astebner\/archive\/2008\/08\/28\/8904493.aspx\" target=\"_blank\">using a cleanup tool<\/a> and reinstalling them one-by-one). \u00a0<em>Thanks to Aaron Stebner for his excellent reference material on this subject, by the way.<\/em><\/p>\n<p>On Vista and 7, many .NET Framework versions are actually integrated into the OS. \u00a0As a result, when damaged <em>files\u00a0<\/em>are responsible for its failure, you can often correct the problem using\u00a0<strong>sfc \/scannow<\/strong>. \u00a0However, when\u00a0<em>this\u00a0<\/em>fails, there&#8217;s actually a pretty straightforward way of making them work.<\/p>\n<p><em>The catch is that the registry entries have to be intact. \u00a0<\/em>There is, unfortunately, no easy way to restore these entries without a repair install (or &#8220;in-place upgrade&#8221; as it&#8217;s called in Vista\/7). \u00a0In the event of disk failure and recovery, it&#8217;s very likely that if you&#8217;re able to boot, the registry is in working condition. \u00a0So if an <strong>sfc<\/strong>\u00a0operation fails, it&#8217;s most likely that the file in the recovery store is\u00a0<em>also\u00a0<\/em>corrupt. \u00a0You can verify this by checking the CBS log for SFC entries (denoted by [SR]). \u00a0An easy way of doing this is to run this command once the\u00a0<strong>sfc\u00a0<\/strong>has finished its operations:<\/p>\n<blockquote>\n<pre>findstr \/c:\"[SR]\" %windir%\\logs\\cbs\\cbs.log &gt;sfcdetails.txt<\/pre>\n<\/blockquote>\n<p dir=\"ltr\">This command searches the CBS log for entries related to SFC operations and outputs all of the matching lines to another file called\u00a0<strong>sfcdetails.txt<\/strong>. \u00a0If a corrupt file is found in the store and cannot be used to repair another damaged system file, you&#8217;ll see an entry like this one:<\/p>\n<blockquote>\n<p dir=\"ltr\">[SR] Could not reproject corrupted file {filename}; source file in store is also corrupted<\/p>\n<\/blockquote>\n<p dir=\"ltr\">My solution? \u00a0Pretty simple really; from a healthy Windows 7 64-bit system (the same OS as the patient PC), I <strong>backed up\u00a0<\/strong>and then <strong>manually copied all files<\/strong> within these directories:<\/p>\n<blockquote>\n<p dir=\"ltr\">%windir%\\Microsoft.NET\\assembly<br \/>\n%windir%\\Microsoft.NET\\Framework<br \/>\n%windir%\\Microsoft.NET\\Framework64<\/p>\n<\/blockquote>\n<p dir=\"ltr\">As far as I know, the contents of these directories on identical, up-to-date Windows versions are standardized. \u00a0My suspicions were validated when, upon the next boot, the patient PC was suddenly working perfectly, with no adverse side effects!<\/p>\n<p dir=\"ltr\">By the way, while we&#8217;re on the subject of the SFC, one more solution to the problem is to simply replace every file it can&#8217;t repair as detailed <a title=\"How to troubleshoot using SFC\" href=\"http:\/\/support.microsoft.com\/kb\/929833\" target=\"_blank\">here<\/a>. \u00a0But you can also copy good versions of the files to the winsxs directory in the proper location and then perform a subsequent SFC operation to have it replace them for you. \u00a0Either approach works!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These days I do a considerable amount of data recovery for my clients, and as you might expect, when dealing with failing drives, it isn&#8217;t always possible to recover all of the information. \u00a0Even the sophisticated hardware-based imaging tools I &hellip; <a href=\"https:\/\/www.triplescomputers.com\/blog\/casestudies\/repairing-the-net-framework-in-windows-vista7\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[90,91,92],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-casestudies","tag-net-framework","tag-sfc","tag-system-file-check"],"_links":{"self":[{"href":"https:\/\/www.triplescomputers.com\/blog\/wp-json\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.triplescomputers.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.triplescomputers.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.triplescomputers.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.triplescomputers.com\/blog\/wp-json\/wp\/v2\/comments?post=142"}],"version-history":[{"count":0,"href":"https:\/\/www.triplescomputers.com\/blog\/wp-json\/wp\/v2\/posts\/142\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.triplescomputers.com\/blog\/wp-json\/wp\/v2\/media?parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.triplescomputers.com\/blog\/wp-json\/wp\/v2\/categories?post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.triplescomputers.com\/blog\/wp-json\/wp\/v2\/tags?post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}