如何在没有Visual Studio的情况下调试.net应用程序

ljs*_*ljs 19 .net debugging remote-debugging

如果之前有人询问过,请告诉我,我无法就此问题找到任何问题: -

我需要确定在安装了.net框架但不是Visual Studio的计算机上抛出的异常的内部异常(也不可能在计算机上安装Visual Studio).我该如何检查这个内部异常?

注意几点:

  • 从另一台计算机上运行Visual Studio并不好,因为问题实际上在于盒子上; 这是第一个订单的heisenbug.
  • 我知道WinDbg是一个选项,但是我需要快速完成这项工作,不幸的是我想到了足够时间学习WinDbg来完成这项工作将超过我的时间 - 但是如果有人对此有逐步说明我会感兴趣.
  • 我有完整的管理员权限,可以安装任何不太大的东西(安装VS的问题是硬盘空间不足).

谢谢!

Sam*_*ron 12

你看过MDBG了吗?您可能需要一段时间才能到处走走,但相当直接.

此外,DbgClr可能是一个选项,我认为它仍然应该在SDK的某个地方.


Bri*_*sen 8

如果您有崩溃转储,使用WinDbg执行此操作实际上非常简单.将转储装入WinDbg,加载sos,然后运行printexception命令.

>.load sos
>!printexception
Run Code Online (Sandbox Code Playgroud)

这将告诉您异常以及指向内部异常.输出将是这样的:

0:000> !printexception
Exception object: 0135b340
Exception type: System.ApplicationException
Message: GetAverage failed
InnerException: System.IndexOutOfRangeException, use !PrintException 01358394 to see more
<stack trace follows>
Run Code Online (Sandbox Code Playgroud)

如果您还没有内存转储,可以使用adplus(WinDbg附带)创建一个内存转储.

>adplus -crash -o<dump location> -quiet -pn<name of process>
Run Code Online (Sandbox Code Playgroud)

如果您更喜欢使用PID,请使用该-p选项.