Search code examples
c#exceptionwindbgsos

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

Solution

  • 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.