如何查看 .NET 应用程序的堆栈跟踪
我在生产中有一个 .NET Windows 应用程序,无法访问 Visual Studio(标准版本),他们唯一可以安装的是 Express 版本,该版本不支持有“即时调试”选项(崩溃时有调试按钮的选项)。所以我只是想知道是否有 Windows 应用程序调试工具或其他可以运行或附加的工具来查看堆栈跟踪。我还在我的应用程序中启用了 PDB ,但它没有提供任何更多信息,所以我可以跟踪我的崩溃(由未处理的异常引起)。
I have a .NET Windows application in the production that has no access to Visual Studio (standard edition), and the only thing they can install is the Express edition, which does not have the Just-In-Time Debugging option (the one which has the debug button when it crashes). So I was just wondering if there is a Windows application debugging tool or something else that I can run or attach to see stacktraces. I also enabled PDB in my application, but it does not provide any more information, so I can trace my crashes (caused by unhandled exceptions).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
如果您正在捕获异常,则 Exception 对象包含堆栈跟踪: 异常.StackTrace。此外,您还可以通过 Environment.StackTrace。
在下面的代码中还有一个用于未处理异常的事件处理程序,它将把异常(包括堆栈跟踪)写入事件日志。
If you are catching exceptions, the Exception object contains the stack trace: Exception.StackTrace. Also, you have access to it with Environment.StackTrace.
In the code below there is also an event handler for unhandled exceptions which will write the exception, including the stack trace, to the event log.
您还可以使用windbg和sos.dll
You can also use windbg and sos.dll
您可以尝试CLR Profiler
You could try the CLR Profiler
.NET 应用程序异常的堆栈跟踪记录在事件查看器的“应用程序”下。
此链接抛出 404:
替代文本 http://eduncan911。 com/blog/thumbnail/exception-in-iis-stackoverflow-logs.png
The stacktraces of .NET application exceptions are logged in your Event Viewer under Applications.
This link throws a 404:
alt text http://eduncan911.com/blog/thumbnail/exception-in-iis-stackoverflow-logs.png
也许 EQATEC Tracer 可以帮助您。
Maybe the EQATEC Tracer could help you out.
使用:
.NET Framework 2.0 软件开发工具包 (SDK) (x86)
.NET Framework 2.0 SDK 附带 Microsoft CLR 调试器。它的工作方式与 Visual Studio 调试器类似(尽管源文件是只读的),因此您可以尝试一下。
Use:
.NET Framework 2.0 Software Development Kit (SDK) (x86)
.NET Framework 2.0 Software Development Kit (SDK) (x64)
.NET Framework 2.0 SDK ships with Microsoft CLR Debugger. It works similar to Visual Studio debugger (though source files are readonly), so you can give it a try.