I recently got a new PC at work and had to reinstall development tools, etc. The PC runs Windows XP (blech), and I've got Visual Studio 2010 and .NET Frameworks 2.0, 3.5, and 4.0 installed, each with all current service packs and patches. Windows XP itself is also up-to-date (if one could say that :-)
One recurring problem I've noticed is the following dialog, which tends to pop up after the machine has been idle for a bit:
I suspect the crash is due to the .NET Framework performing Ngen compilation of system assemblies in the background, and crashing when it reaches one assembly in particular.
I've found another mention of this problem at the MSDN forums, and one of the suggested workarounds is to configure Windows XP's Data Execution Prevention feature to "Turn on DEP for essential Windows programs and services only". However, that's already the setting in effect on my PC.
How can I diagnose further? When I try to attach to the process, it's already gone.
Are there any other suggested or likely fixes?
I ran the following at a Command Prompt:
ngen executequeueditems .. this now lets me reliably reproduce the problem instead of waiting for the idle background ngen to execute.
ngen.exe got to the following entry:
Compiling assembly Microsoft.SqlServer.Management.MultiServerConnection, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91 (CLR v2.0.50727) ... WARNING: Cannot hardbind to mscorlib, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089 because dependency does not have a native image (check FusLogVw for reason) Failed to generate native code for dependent image Microsoft.SqlServer.Management.MultiServerConnection, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91 because of the following error: The remote procedure call failed. (Exception from HRESULT: 0x800706BE)
... the result was the following error dialog:
Whereas, other assemblies that failed native image generation didn't actually cause a crash, just an error message.
So, the specific assembly this is failing on is: Microsoft.SqlServer.Management.MultiServerConnection.
What else can I do? I don't particularly care if it can be ngen'd or not at this point; I simply want to stop this annoying recurring error dialog from above. I already tried:
ngen uninstall Microsoft.SqlServer.Management.MultiServerConnection,
... but it says "ERROR: The specified assembly is not installed."
Is there a way to remove an assembly from the ngen queue, so ngen won't even try to generate a native image for it?