Need help getting NGen back into working condition
Asked Answered
C

3

7

NGen is unhappy on my computer, and i can't find a way to get a deep understanding of what is going wrong.

After every startup, ngen logs this message:

.NET Runtime Optimization Service (clr_optimization_v2.0.50727_32) - Service reached limit of transient errors. Will shut down. Last error returned from Service Manager: 0x8000ffff.

And when i try to start the optimization service at the commandline i get that same error logged again.

I managed to start the ngen service and immediately pause the queue (by writing a two line batch file, like this:

net start clr_optimization_v2.0.50727_32

ngen queue pause

so now i tried clearing out the queue, by executing items at different status levels, like this:

ngen executequeueditems 3 /nologo /verbose

but the result is always:

Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

...along the way i've uninstalled/re-installed visual studio 2008. And i've uninstalled SQL server 2005, and i've run the 'system file checker': sfc /scannow

Running short of ideas, and would love help from an ngen expert.

How do i get info such as "What's causing these catastrophic failures?" (note that the /verbose option doesn't increase the amount of info I find out. "What files are in the queue to be generated?" -- Can I remove some of those files, or pin the blame on a particular file...

Uninstalling and reinstalling the .net framework 2.0 isn't easy, as this is vista and it's a protected part of the operating system.

Update: i've also tried the advice offered here (and mentioned in the first reply) -- but i just get the same catastrophic failure message.

C:\Windows\Microsoft.NET\Framework\v2.0.50727>ngen executequeueditems /nologo Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

Cab answered 7/2, 2009 at 14:56 Comment(3)
I smell an OS reinstall in your future..Saury
this sucks. I have the same issue with installing MVC ASP.net RC2 Anyone got a solution for fixing ngen?Penthea
Hi Harry -- Phil Haack's description here might be helpful. haacked.com/archive/2009/03/05/troubleshooting-installers.aspx I eventually used Orca.exe to remove the ngen step from the MVC installer.Cab
C
3

In answer to this part of the question:

"What's causing these catastrophic failures?"

There's two log files that can help answer this:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen.log
C:\Windows\Microsoft.NET\Framework\v2.0.50727\ngen_service.log

(As well as the usual application log, though it is less helpful)

In answer to:

"What files are in the queue to be generated?"

The usual answer is that this can be seen by running:

ngen.exe display

(Though in my case it only returns

NGEN Roots:    
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

)

Cab answered 12/2, 2009 at 13:31 Comment(1)
How was this an 'Answer' to the problem? By ticking this you are just stopping other answersPenthea
P
2

From this:

The .NET Runtime Optimization Service attempts to re-try compilation of assemblies when it runs into what it believes are transient errors; examples include RPC errors, out-of-memory errors etc. However, after it has tried to compile the same assembly 20 times and has still failed to do so, it outputs the message above and shuts down. I see that you've already tried to uninstall .NET Framework 2.0 from your machine and re-install it, but that you still have this error. I am guessing that trying to repair the install doesn't help either. Can you possibly try to run "ngen.exe ExecuteQueuedItems" followed by "ngen.exe Update" from %WINDIR%\Microsoft.NET\Framework\v2.0.50727\? That will attempt to compile all assemblies that don't yet have any/up-to-date 32-bit NGen images synchronously without going through the optimization service. Once the update command completes, can you once again try starting the service and checking to see whether you still get the same message in the system log? If this problem is not specific to the service, I expect that you will see compilation errors in the command-line output as well.

Photofluorography answered 7/2, 2009 at 19:3 Comment(1)
hi bobby. i updated the question to mention what happened when i tried this. (it failed, but took over 256 chars to explain that ;-) )Cab
P
1

I had the same problem (installing Asp MVC 1.0). Looking for the answer I've spotted Haacked Blog where some reasons have been explained. Having spent 2 hours of trying to solve this I was so frustrated that I have used

ngen /delete *

It worked. But i'm not sure if it wouldn't make small disaster ;/

Maybe this will help..

Preventive answered 2/9, 2009 at 13:43 Comment(2)
Good work kliszaq! Please report back if "ngen /delete *" leads to any other issues for you.Cab
I have not noticed yet any bad issues of this soultion. Even "if", it is not a problem for me because I'am to upgrade my Vista to Windows 7 in the next week.Preventive

© 2022 - 2024 — McMap. All rights reserved.