David Overton's Blog and Discussion Site
This site is my way to share my views and general business and IT information with you about Microsoft, IT solutions for ISVs, technologists and businesses, large and small. I specialise in Windows Intune and SBS 2008.
This blog is purely the personal opinions of David Overton. If you can't find the information you were looking for e-mail me at admin@davidoverton.com.

To find out more about my Windows Intune BOOK - Microsoft Windows Intune 2.0: Quickstart Administration click here

To find out more about my SBS 2008 BOOK - Small Business Server 2008, Installation, Migration and Configuration click here

How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
David Overton's Blog

Buy my books

Windows Intune:Quickstart Administration


This is the RAW book (Read as Written).
Click here for more information
Buy or pre-order today

SBS 2008 - Installation, Migration and Configuration

Small Business Server 2008 – Installation, Migration, and Configuration

Buy today in book or e-book form

Request a Review Copy

Twitter

Syndication

My boss had some problems on his PC after installing some tools onto it and upon further diagnosis it appeared to be that the .Net Framework had been corrupted.  We did all the usual things of looking in "Add/Remove Programs" etc, adding service packs etc all to no avail.  I then came across this blog entry and a fix started to come to light

How to repair the .NET Framework 2.0 and 3.0 on Windows Vista

Since the Windows Vista public launch in January 2007, I have been receiving questions about how to repair the .NET Framework 2.0 and 3.0 to try to resolve various bugs.  As I previously described here, the 2.0 and 3.0 versions are installed as OS components on Windows Vista and do not appear in the Programs and Features (formerly known as Add/Remove Programs) control panel.

Many of the customers I have heard from have tried to use the .NET Framework cleanup tool, but it does not list the .NET Framework 2.0 as a valid removal option when it is run on Windows Vista.  This is by design - the cleanup tool does not offer the option to remove any version of the .NET Framework that is an OS component on the OS it is being run on.

Aaron Stebner's WebLog : How to repair the .NET Framework 2.0 and 3.0 on Windows Vista

 

The important things seem to be:

  1. Don't use the clean up tool
  2. Try the command "sfc /scannow" from an elevated command prompt
  3. Repair the (V2) framework with the command "%windir%\Microsoft.NET\Framework\v2.0.50727\ngen.exe update" again from an elevated command prompt

The 1st item stops corruption, then 2nd checks the OS's binary (core internal files) are correct and matching their signatures and the final one re-creates all the "native" files from the IL code.

 

ttfn

David


Posted Fri, Feb 1 2008 7:32 AM by David Overton

Comments

Korrumpiertes .NET-Framework in Windows Vista reparieren | Windows Vista Blog wrote Korrumpiertes .NET-Framework in Windows Vista reparieren | Windows Vista Blog
on Fri, Feb 1 2008 12:34 PM

Pingback from  Korrumpiertes .NET-Framework in Windows Vista reparieren | Windows Vista Blog

AL wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Fri, Apr 18 2008 5:34 PM

Thank you

Chris wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Tue, Oct 14 2008 7:22 PM

Thanks!

Alexandra wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Sun, Nov 9 2008 10:59 PM

I tried to repair this tool in all posible ways but even this does not work, is there something else i can do?

Shawn Harvey wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Wed, Jan 14 2009 8:07 AM

ER.... vista 7 beta failure:  After I tried to install the 2.0 sdk and fiddled around with starting a few (of the nearly 1,000) services.

to wit:

E:\Windows\Microsoft.NET\Framework\v2.0.50727>ngen update

Microsoft (R) CLR Native Image Generator - Version 2.0.50727.3521

Copyright (c) Microsoft Corporation.  All rights reserved.

Failed to load dependency Microsoft.MediaCenter of assembly ehExtHost32, Version

=6.0.6000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 because of the fol

lowing error : The system cannot find the file specified. (Exception from HRESUL

T: 0x80070002)

Failed to load dependency Microsoft.MediaCenter.UI of assembly ehExtHost32, Vers

ion=6.0.6000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 because of the

following error : The system cannot find the file specified. (Exception from HRE

SULT: 0x80070002)

Failed to load dependency ehiExtens of assembly ehExtHost32, Version=6.0.6000.0,

Culture=neutral, PublicKeyToken=31bf3856ad364e35 because of the following error

: The system cannot find the file specified. (Exception from HRESULT: 0x8007000

2)

Failed to load dependency stdole of assembly ehiVidCtl, Version=6.1.0.0, Culture

=neutral, PublicKeyToken=31bf3856ad364e35 because of the following error : The s

ystem cannot find the file specified. (Exception from HRESULT: 0x80070002)

Failed to load dependency stdole of assembly ehiVidCtl, Version=6.1.0.0, Culture

=neutral, PublicKeyToken=31bf3856ad364e35 because of the following error : The s

ystem cannot find the file specified. (Exception from HRESULT: 0x80070002)

All compilation targets are up to date.

From ngen.exe update (as you directed, kind sir).  I'm wondering if it can really not find it or if it's a victim of your Novell-on-Acid rights inheritance schema.  Ah, oh... did the sfc as well.  Does it just look at files or also the securities on them?

I'd kind of like to fix this because (kudos to MS and in a big way) this beta is more stable than the v6 I have on my other drives.  Not too crazy about a few features and it sticks once in a while but guess what, no bsods.  Now that's a major upgrade!  (no sarcasm implied -- I am impressed so far).

By the way, your level 2 and 3 tech support is superb.  Had to bring in a 3 for a 07 bsod with a gigabyte motherboard (they denied everything and hinted it was NVIDIA's fault- which is probably true).

David Overton wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Wed, Jan 14 2009 8:17 AM

I just checked the programs list on my Win 7 system - no dot net framework 2 - try installing it :-)

Winer Reales wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Wed, Mar 11 2009 1:27 PM

%windir%\Microsoft.NET\Framework\v2.0.50727\ngen.exe update

Help me but i must use Windows Installer CleanUp Utility u to clean rest from framework 1.1. If you need go to Microsoft and download.

support.microsoft.com/.../290301

anti.spy wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Sun, Apr 5 2009 1:49 AM

=please give me the link of net framework 2.0 for windows vista.

I downloaded some framework and its not compatible in windows vista. please give me the link...

David Overton wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Sun, Apr 5 2009 9:04 AM

Vista has .Net framework V2 built in, so there is no download needed.

Thanks

David

Emc78 wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Sun, Apr 19 2009 5:38 PM

Hi, I'm pretty sure I have >net 1.1 on my OS and I have tried the link in the command prompt. I get the ngen failed to initialize box, any idea's on how to repair my framework?

Thanks

em

mike wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Mon, Aug 24 2009 5:17 PM

worked!

great stuff..

thanks a lot

augied wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Mon, Sep 28 2009 1:06 AM

I guess I need a little help. I am not sure how to implement the

%windir%\Microsoft.NET\Framework\v2.0.50727\ngen.exe update

part of your solution

cLu3L3ss wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Fri, Oct 23 2009 11:06 AM

Okay I did what was said and the third one pulled this up

C:\Windows\system32>%\Mircrosoft.NET\Framework\v2.0.50727\ngen.exe update Microsoft <R> CLR Native Image Generator - Version 2.0.50727.3053 Copyright <c> Microsoft Corpooration. All rights reserved. Failed to load dependency Microsoft. Web.Administration of assembly Service Mode 1Reg, Version=3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a because of the following error : The system cannot find the file specified. <Exception from HRESULT: 0x80070002> All compilation targets are up to date.

Brad wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Sat, Nov 7 2009 5:58 AM

Is there a comparable repair command for the x64 framework folder?

David Overton wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Sun, Nov 8 2009 10:19 AM

Brad,

I found the commands worked just fine on my system replacing Framework with Framework64.

Thanks

Daryl Petersen wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Wed, May 12 2010 9:47 PM

I had a corrupt System.Web.Dll (zero size) in the 2.0 framework folders on my Windows 7 machine that was causing all my issues (mainly with VS2010). Tried everything here to repair it but no luck. Ended up taking ownership and replacing the corrupt file with a copy from another machine.

Also tried all sorts of repair/reinstalls of the 2.0 framework but absolutely nothing worked. What a nightmare.

All good now though, AFAIK.

Lisa A wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Fri, Jun 18 2010 2:34 PM

I had a website that would crash with a .NET (2.0) error, and no amount of fixing I did repaired the problem - these instructions worked like a charm! THANK YOU!

Roba wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Sun, Oct 31 2010 12:51 AM

Thank you for suggesting the three step directions to resolve the Microsoft.Net framework issue.  But it did not resolve my problem as the first step I did via sfc/scannow showed that my computer has corrupted files.  So please advise what I need to do before I could go on with the step #2?

David Overton wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Tue, Nov 2 2010 6:42 AM

if you have corrupt files, personally I would re-load the OS.  Do you know how you got corrupt files?  If not, then there is a risk it will happen again.  Try the MS security scanner and see if some nasty is on the system.

Thanks

David

Drew wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Tue, May 3 2011 1:11 PM

I've had success with the following method:

- Use the .NET Removal tool found on Google and remove all versions then reboot.

- Next find a computer with the same OS and Service Pack, in my situation XP SP3. Copy C:\WINDOWS\System32\mscoree.dll from that computer to a thumb drive.

- On that same computer open REGEDIT and go to HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework and Export that onto the thumbdrive with any filename.

- Right click the .REG file on your computer and select merge. Also copy that mscoree.dll from your USB to your C:\Windows\System32 folder.

Gh0ST wrote re: How to repair the .NET Framework 2.0 and 3.0 on Windows Vista
on Tue, Jun 28 2011 8:43 AM

Thanks Drew it worked for me in VISTA SP2 after I've got various errors and after trying ALL EXISTING SOLUTIONS found on the WEB ( except reformat ).

I even delete "accidentally" NETFramework  folder from windows in a stupid ultimate attempt... to make a clean install

Any update to 3.5 or 3.5 SP1 was rejected at last at 99% with missing optional 3.0 components etc...

I lost the even viewer console than etc ...

Since it was impossible to recover the native Netframework V3.0 I tested your solution.

Merging HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework from a similar vista sp2 computer but also copying from thumb drive the whole C:\WINDOWS\Microsoft.NET folder and subfolders was fine and I was finally able to install/update the evil .Net

1) clear all versions

2) Delete %TEMP% folder content

3) Reboot

4) Copy all mscor*.dll from SYSTEM32 from a similar computer with uptodate Vista SP2 ( if dll are different and If the system don't let you do that just boot from an alternate sytem like a CD or Ubuntu and forcefully replace them )

5) Merge  HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework  from another SP2 Vista computer

6) Merge C:\WINDOWS\Microsoft.NET from same computer

7) REBOOT

7) Apply standalone .NET updates 3.5

8) Reboot

9) Same with 3.5 SP1 and  KB fixes

10) Reboot ;-)

THANKS ALL for the tools and the tips !

Add a Comment

(optional)  
(optional)
(required)  
Remember Me?

(c)David Overton 2006-13