Need help getting NGen back into working condition

Leon Bambrick picture Leon Bambrick · Feb 7, 2009 · Viewed 10.4k times · Source

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))

Answer

Leon Bambrick picture Leon Bambrick · Feb 12, 2009

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))

)