Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to set break points when remote debuging with Visual Studio?

I am able to connect to the remote machine and debug and see the source code, but when I set a break point Visual Studio don't break on it.

So is there something that needs to be done?
Or is it simply not possible to use breakpoints while remote debugging?

like image 925
Karim Avatar asked Dec 08 '09 23:12

Karim


People also ask

How do I debug a remote process in Visual Studio?

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.

How do I debug a breakpoint in Visual Studio?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.

How do I set debug configuration in Visual Studio?

In Solution Explorer, right-click the project and choose Properties. In the side pane, choose Build (or Compile in Visual Basic). In the Configuration list at the top, choose Debug or Release. Select the Advanced button (or the Advanced Compile Options button in Visual Basic).

Can you set breakpoints in VS Code?

Breakpoints. Breakpoints can be toggled by clicking on the editor margin or using F9 on the current line. Finer breakpoint control (enable/disable/reapply) can be done in the Run and Debug view's BREAKPOINTS section. Breakpoints in the editor margin are normally shown as red filled circles.


2 Answers

Yes it is. You need to make sure that the PDB (debug information with line info) is present and loaded in the debugger when connecting to the remote site, because without it the debugger cannot associate source lines to bytecode offsets, which is required to set a breakpoint.

like image 136
Lucero Avatar answered Sep 28 '22 09:09

Lucero


The quick answer is yes, however there are a number of different things that might be stopping the break point from being triggered. Long ago I posted this checklist as an answer to another question, it might help you now:

Why does my C# debugger skip breakpoints?

In particular check to see if the graphic for the breakpoint is solid (indicating that the breakpoint should be hit if you reach it) or if the breakpoint is just an empty circle with a little exclamation mark next to it - if you get the exclamation mark then check the tool tip you get when you hover over it, it might tell you what the problem is.

Finally, its perfectly possible to debug a RELEASE build, however you need to make sure that you produce symbols when you build - these can either be in an external file (a .pdb), or sometimes they can be embedded into the assembly itself (although I've never done this myself)

like image 36
Justin Avatar answered Sep 28 '22 11:09

Justin