I'm setting up a Visual studio remote debugging session for a standard Windows Forms application written in C#.
On the Internet are a lot of stories about how to set up the remote computer and MSVCMON.EXE, but I can't find any stories about what to do on my computer to make sure that my program is debugged on the remote computer when I press START DEBUGGING.
So what should I do to make remote debugging possible?
Set up the debugger First, we need to set up the run/debug configuration that will be used for attaching to the host application. From the main menu, select Run | Edit Configurations or press Alt+Shift+F10 then 0 . and select Remote JVM Debug.
Spawning a new process on the same computerIn Visual Studio, from the Tools menu, choose Launch Under Debugger. In the Launch Under Debugger dialog box, enter the path to the executable file. You can also enter arguments and a working directory. Click Launch.
You can attach the Visual Studio debugger to a running process on a local or remote computer. After the process is running, select Debug > Attach to Process or press Ctrl+Alt+p in Visual Studio, and use the Attach to Process dialog to attach the debugger to the process.
After some research I have found how to do it, even if you are working in a company that has a lot of safety issues with firewalls, etc. The only thing that I need from the IT department is administrator rights on both computers.
Prerequisites:
How to do it:
The msvsmon.exe program should now be waiting for new connections. The name of the server is something like "remote computer name" : "port number", for instance Prototype1:4016
.
Now on the local computer where you will develop your program using Visual Studio do the following:
\\Prototype1\Users\Harald\Documents\CameraTestProgram\
.Prototype1:4016
.This method works if you want to debug a normal Windows Forms application written in C#. I detected that it even works if you use unsafe code. There are some warnings though if your program contains C++ code, but they can be ignored.
Microsoft links for this (worked October 2013, and still in August 2015):
Microsoft description on how to setup remote debugging. This link does not work anymore on June 2017.
Microsoft: how to set up remote debugging. It worked in June 2017
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With