Breakpoint did not hit Visual Studio Remote Debugging

Pls don't put it as a duplicate .. bcoz I saw all the solutions, but nothing works for my case.

I have two devMachine and serverMachine machines

at devMachine I am developing an application with Visual Studio and now I have a simple console application . I need that I need to run this Console application in serverMachine and is debugging from devMachine via Remote Debugging .

As said in a Microsoft document, I installed the Remote Debugging Tool in serverMachine and set the authentication mode to Native (without authentication) and run the console application in serverMachine.

Now I have connected the remote process in devMachine Visual Studio. Everything is working fine

But only breakpoint problem doesn't hit in Visual Studio

Note. . I placed the required .pdb file in serverMachine and set the path to the .pdb file in devMachine Visual Studio ( Tools-> Option-> Debugging-> Symbols ).

enter image description here

Can someone help me solve this problem?

+6
source share
3 answers

What does the error message at breakpoints say (if you hover over a breakpoint) - what is it different from the source? → You can try to disable (from Tools / Options / Debugging) - Include the source file to exactly match the original version

What does the Modules window say - does the PDB appear as loaded? if not, try downloading them manually (from the Modules window, right-click PDB and load)? - Is there an error message if it does not work?

-> you may be the case if the source files on the local computer are different from the source files on the remote. Try copying everything and see if it works (PDBs will be in the same folder as EXE)

+8
source

There are two reasons why the remote debugger did not hit a breakpoint.

  • Invalid characters.

  • Using the wrong .Net structure during debugging (you can select in the "Attach process" window in visual studio).

+1
source

Looking at your screenshot, maybe it's just because the breakpoints are in the "main" function, which could already be finished before you can attach the debugger?

Suggestion: Maybe put some artificial wait / delay code, for example, 20 seconds in the "main" above the first breakpoint, to give yourself enough time to join the process until the "main" completes.

+1
source

All Articles