Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need help getting NGen back into working condition

Tags:

.net

clr

ngen

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

like image 835
Leon Bambrick Avatar asked Feb 07 '09 14:02

Leon Bambrick


2 Answers

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

)

like image 167
Leon Bambrick Avatar answered Nov 12 '22 09:11

Leon Bambrick


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.

like image 2
BobbyShaftoe Avatar answered Nov 12 '22 11:11

BobbyShaftoe