2

I constantly run into problems where a program runs fine on my system (installed and in development environments) but fails on a users system.

The best solution I can conceive is to debug the program on the users computer, but that's not practical since it would require me to install VS on their system and move the source code over (and doing so would compromise the integrity of the test environment anyway since it may cause the bug to vanish).

I want to remote debug but what I'm reading from the MSDN says to me "Nope, you can't do that unless both systems are on the same network (all. my. rage.)" :

Network configuration The remote computer and the Visual Studio computer must be connected over a network, workgroup, or homegroup, or else connected directly through an Ethernet cable. Debugging over the Internet is not supported.

Is there another option I can use to connect to the process that is running on another system outside my network?

Will
  • 3,413
  • 7
  • 50
  • 107
  • 4
    use lots and lots of logging on the server. is there a reason you can't reproduce the issue on your local environment? – user1666620 Dec 01 '15 at 17:42
  • 1
    Most companies solve this issue by logging to a text file and then having some way to get the log file remotely. – Seth Kitchen Dec 01 '15 at 17:46
  • 1
    HOW does your app fails there? Is there an error message? – Vlad Feinstein Dec 01 '15 at 17:46
  • @user1666620 Gremlins. I don't know why it fails on their system and works on mine (I'm not responsible for the conception of this demon; I was just the unfortunate individual who inherited it). – Will Dec 01 '15 at 18:35
  • @SethKitchen Yeah we're trying that... unfortunately it's not working very well. Also, see above comment wherein I describe the problem is that I inherited this godforsaken piece of software against my will... – Will Dec 01 '15 at 18:36
  • @VladFeinstein In two ways - The one I've observed is it just locks up upon a certain incident; the other (which I have not) is a more verbose and diagnostically friendly issue (exception message, stack trace, bla bla bla). – Will Dec 01 '15 at 18:37
  • The Windows Event Log should capture pertinent info about your application crash. If an exception is being thrown, details will be in there. You can also write information to the EventLog object instead of having a text file for logging. This is beneficial, because you can see your application events within the context of other application / system events, which will be especially helpful considering your issue appears to be related specifically to users environment. Also, if your app is locking up but not the system, then the Event Log should have info about the OS killing the runaway thread. – HBomb Dec 01 '15 at 19:00
  • One free and robust logging tool is [Log4Net](http://logging.apache.org/log4net/). It doesn't take long to configure within a project and can provide you with a full stack trace, variable values, and anything else you might need. It takes configuration, but the log information can be the difference between hours of debugging and minutes. (Other tools can work just as well. But I've used this one, it's free and pretty nice.) – DeadZone Dec 01 '15 at 19:59
  • If you can't get a crash dump from your user as Vlad suggests in his answer, would it be possible for you to VPN into their network so that you are both on the same network? – Reacher Gilt Dec 01 '15 at 20:28

2 Answers2

1

A partial solution (for the case that throws an exception).

Instead of trying to reach client app over the Internet, generate crash dump and debug it locally, in a comfort of your home :). Please see MSDN for details.

Vlad Feinstein
  • 10,960
  • 1
  • 12
  • 27
1

You can use a tunneling application (like hamachi). This will allow you to connect the other party like you're on the same network. Then you can use the remote debugging option. But even in local network remote debugging works slow and sometimes fail with code-optimized builds. Before using the "remote debugger" (by assuming there is any exceptions) I suggest to log all exceptions to a log file then watch the system. It will be helpful to put .pdb files to the remote system to see the relations between code.

Community
  • 1
  • 1
Mert Gülsoy
  • 2,779
  • 1
  • 19
  • 23