简体   繁体   English

在非开发机器上使用逐步调试所需的最低要求

[英]Minimum needed to use Step-by-Step debugging on non-development machine

I have the source code for a C# project (which wasn't written by me) which I run on one of our servers. 我有一个C#项目的源代码(我不是由我编写的),我在我们的一台服务器上运行。

There is a particular part of this program (a menu option) which occasionally fails silently and I can't figure out why from just looking at the source. 这个程序的一个特定部分(一个菜单选项)偶尔会无声地失败,我无法从只看源头找出原因。 (The part of the program that fails requires various features that are not on my development machine, so I can't test it on my own machine). (失败的程序部分需要我的开发机器上没有的各种功能,所以我无法在自己的机器上测试它)。

I would like to debug this program and in particular step through the code line by line. 我想调试这个程序,特别是逐行完成代码。 Since the server is outside our firewall, remote debugging feature will not work. 由于服务器位于防火墙之外,因此远程调试功能不起作用。

Is there any alternative other than installing Visual Studio on the server, ie are there any runtime debuggers that will show the C# source code and allow you to set breakpoints etc? 除了在服务器上安装Visual Studio之外还有其他选择吗,即是否有任何运行时调试程序将显示C#源代码并允许您设置断点等?

The project was written in VS 2008 and targets Framework 2.0. 该项目是在VS 2008中编写的,目标是Framework 2.0。

You should be able to use DbgClr for a framework 2.0 app. 您应该能够将DbgClr用于框架2.0应用程序。 It is a standalone graphical debugger that comes with the SDK. 它是SDK附带的独立图形调试器。 You will need to ensure that the PDB files, that matches the running build of the application, are available to the debugger. 您需要确保调试器可以使用与应用程序的运行版本匹配的PDB文件。

That being said, if you have any option to punch a hole in the firewall, so you can use remote debugging , that would probably be the easiest way to go. 话虽如此,如果您有任何选项可以在防火墙上打孔,那么您可以使用远程调试 ,这可能是最简单的方法。

Of course, it would be best practice to setup your local environment so you can reproduce the bug and debug locally; 当然,最佳实践是设置本地环境,以便您可以重现错误并在本地进行调试; but I can understand if there are reasons that might make this unfeasible. 但我能理解是否有可能导致这种不可行的原因。

Another option is to use WinDbg with the SOS extensions. 另一种选择是使用带有SOS扩展的WinDbg It's an extremely light weight debugger that doesn't even require the .Net framework to be installed. 它是一个非常轻量级的调试器,甚至不需要安装.Net框架。 It leaves much to be desired in the way of UI and has a steep learning curve. 它在UI的方式上有很多不足之处,并且具有陡峭的学习曲线。 But once you get the hang of WinDbg it's an amazingly powerful debugging tool. 但是一旦你掌握了WinDbg,它就是一个非常强大的调试工具。

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

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