Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see managed exception details in WinDBG?

VS2005 C# Compiler crashes during our team's nightly build process. I attach to it with WinDBG, load SOS extensions, print the callstack, but cannot see exception info.

I tried !PrintException, as follows:

    0:000> !PrintException
    There is no current managed exception on this thread

Here's the top of callstack:

    0:000> !CLRStack
    OS Thread Id: 0x9fc (0)
    ESP       EIP     
    0012ee08 77e4bef7 [ComPlusMethodFrameGeneric: 0012ee08] Microsoft.Build.Tasks.Hosting.ICscHostObject.Compile()
    0012ee18 6be671ab Microsoft.Build.Tasks.Csc.CallHostObjectToExecute()
    0012ee48 6c0aed17 Microsoft.Build.Utilities.ToolTask.Execute()
like image 537
GregC Avatar asked Mar 01 '23 18:03

GregC


2 Answers

The reason you're not seeing an exception is that the C# compiler is not written in managed code. It is a C++ project and hence won't throw a CLR exception. You need to look for a native error instead.

like image 72
JaredPar Avatar answered Mar 09 '23 05:03

JaredPar


I got it! All that needed to be done was to save a dump (*.dmp) file from WinDBG and re-open it in Visual Studio.

For a full solution look at my prior question

like image 30
GregC Avatar answered Mar 09 '23 06:03

GregC