tags:

views:

48

answers:

2

I have the source code for a C# project (which wasn't written by me) which I run on one of our servers.

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?

The project was written in VS 2008 and targets Framework 2.0.

+1  A: 

You should be able to use DbgClr for a framework 2.0 app. It is a standalone graphical debugger that comes with the SDK. You will need to ensure that the PDB files, that matches the running build of the application, are available to the debugger.

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.

driis
Thanks, this seems to work well.
sgmoore
A: 

Another option is to use WinDbg with the SOS extensions. It's an extremely light weight debugger that doesn't even require the .Net framework to be installed. It leaves much to be desired in the way of UI and has a steep learning curve. But once you get the hang of WinDbg it's an amazingly powerful debugging tool.

JaredPar
You had me until you said 'has a steep learning curve' -) Maybe when I have more time.
sgmoore
@sgmoore, it is indeed a very steep learning curve :(
JaredPar