简体   繁体   English

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

[英]How to Debug .net applications without Visual Studio

Please let me know if this has been asked before, I wasn't able to find any questions on this subject:- 如果之前有人询问过,请告诉我,我无法就此问题找到任何问题: -

I need to determine the inner exception of an exception thrown on a computer with the .net framework installed but not Visual Studio (nor is it possible to install Visual Studio on the computer). 我需要确定在安装了.net框架但不是Visual Studio的计算机上抛出的异常的内部异常(也不可能在计算机上安装Visual Studio)。 How can I examine this inner exception? 我该如何检查这个内部异常?

Note a few points: 注意几点:

  • It's no good running Visual Studio from another computer as the problem lies actually on the box; 从另一台计算机上运行Visual Studio并不好,因为问题实际上在于盒子上; it's a heisenbug of the first order. 这是第一个订单的heisenbug。
  • I know WinDbg is an option, however I need this done quickly and unfortunately I imagine the time taken to learn WinDbg sufficiently to get this done will outweigh the time I have - however if anybody has step-by-step instructions on this I would be interested. 我知道WinDbg是一个选项,但是我需要快速完成这项工作,不幸的是我认为完全学习WinDbg所花费的时间将超过我所拥有的时间 - 但是如果有人对此有逐步说明我将是感兴趣。
  • I have full admin permissions and can install anything that isn't too big (the problem with installing VS is that there is insufficient hard drive space). 我有完整的管理员权限,可以安装任何不太大的东西(安装VS的问题是硬盘空间不足)。

Thanks! 谢谢!

Have you had a look at MDBG ? 你看过MDBG了吗? It may take you a while to get around but is fairly straight forward. 您可能需要一段时间才能到处走走,但相当直接。

Also DbgClr may be an option, I think its still supposed to be in the SDK somewhere. 此外, DbgClr可能是一个选项,我认为它仍然应该在某个地方的SDK中。

It is actually fairly simple to do this with WinDbg if you have a crash dump. 如果您有崩溃转储,使用WinDbg执行此操作实际上非常简单。 Load the dump into WinDbg, load sos, and run the printexception command. 将转储装入WinDbg,加载sos,然后运行printexception命令。

>.load sos
>!printexception

This will tell you the exception as well as point you to the inner exception. 这将告诉您异常以及指向内部异常。 Output will be something like: 输出将是这样的:

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>

If you don't have a memory dump already, you can create one using adplus (which comes with WinDbg). 如果您还没有内存转储,可以使用adplus(WinDbg附带)创建一个内存转储。

>adplus -crash -o<dump location> -quiet -pn<name of process>

If you prefer to use PID use the -p option instead. 如果您更喜欢使用PID,请使用-p选项。

您可以使用远程调试: http//msdn.microsoft.com/en-us/library/y7f5zaaa.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM