如何在WinDBG中查看托管异常详细信息?

Gre*_*egC 3 c# compiler-construction windbg exception sos

VS2005 C#编译器在我们团队的每晚构建过程中崩溃.我用WinDBG附加它,加载SOS扩展,打印callstack,但看不到异常信息.

我试过了!PrintException,如下:

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

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

Jar*_*Par 5

您没有看到异常的原因是C#编译器不是用托管代码编写的.它是一个C++项目,因此不会抛出CLR异常.您需要查找本机错误.