Karim
Karim

Reputation: 6283

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?

Upvotes: 7

Views: 6892

Answers (3)

AdmiralThrawn
AdmiralThrawn

Reputation: 392

Yes, you can. Use F9 to create break point. Be mindful of the below while remote debugging..

There are two reasons for the remote debugger to not hit the breakpoint

  1. Wrong symbols.

  2. Using the wrong .Net framework while debugging ( you can select on the "attach to process" window in visual studio).

Upvotes: -1

Justin
Justin

Reputation: 86729

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)

Upvotes: 3

Lucero
Lucero

Reputation: 60190

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.

Upvotes: 12

Related Questions