17

Pls don't mark it as duplicate .. bcoz I have seen all the solutions but nothing is working for my case..

I have two machines devMachine and serverMachine

in devMachine I am developing application with Visual Studio and Now I have a simple Console Application..my need is I need to run this Console Application in serverMachine and debug from devMachine via Remote Debugging.

As told in Microsoft document, I have installed Remote Debugging tool in serverMachine and set the Authentication mode as Native (No Authentication) and run the Console Application in serverMachine.

Now , I have attached the remote process in devMachine's Visual Studio. All are working fine

But only problem is breakpoint is not hitting in Visual Studio

Note: I have placed required .pdb file in serverMachine and set that .pdb file path in devMachine's Visual Studio (Tools->Option->Debugging->Symbols).

enter image description here

Can anyone help me to resolve this issue?

1

5 Answers 5

11

What does the error message on the breakpoints say (if you hover over the breakpoint) - that it's different from the source? --> You can try disabling (from Tools/Options/Debugging) - Enable source file to exactly match the original version

What does the Modules window say - do the PDB's appear as loaded? if not, have you tried loading them manually (from the Modules window, right click the PDB and load)? - Is there an error message if it fails?

--> you might be in a case where the source files in the local machine are different from the ones on the remote one. Try copying everything over and see if that works (PDBs would be in the same folder as the EXE)

3
  • When I tried to load the symbol manually, it says that a matching symbol file was not found in this folder. Do you know what it means?
    – Sky
    Commented Jun 6, 2016 at 9:38
  • @ sky - it means that the matching PDB file wasn't found in that folder - so either you are pointing to the wrong folder, or the PDB file you have there isn't of the same version as the one you are trying to debug, you need to point to the version you are trying to debug
    – Maria
    Commented Jul 22, 2016 at 21:39
  • @Ghiondea Yes, you are right. I've figured it out. Thank you all the same.
    – Sky
    Commented Jul 25, 2016 at 2:42
2

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).

2

Don't attach and just set remote debugging on. Copy all the project files to the identically placed and named folder in the server during post-build.

enter image description here

enter image description here

1

I had an issue with Visual Studio not breaking at my breakpoints although it looked like everything was setup correctly for the remote debugger on an IIS machine. I searched everywhere for an answer. The issue finally presented itself when I tried to manually attach the VS debug to a process (VS menu --> Debug --> Attach to process...) For some reason, there were multiple processes for the same application pool (there should only be one process, not sure where the others came from) I logged into my IIS server and killed all the processes for my application pool and then restarted the IIS application. When I saw there was only one process for the app pool (as I expected), I tried debugging in Visual Studio and it attached to the correct process. It turns out that when there were multiple processes for the same application pool, it attached to the "wrong" one.

1
  • This answer is true and fell in the same loop. Once I created a designated app pool for the .net framework 4.8 based asp.net mvc app, I did get rid of the warning near breakpoint symbol but still VS does not stop. Could be due to exception in Mvc.dll or any other .net library which cant be handled !
    – sanpat
    Commented Jan 14, 2022 at 19:23
0

Looking at your screen shot, could it be simply because the break points are in the "main" function which could already have finished before you can attach the debugger?

Suggestion: Maybe put some artificial wait/delay code of say 20 secs in "main" above the first break point to give yourself enough time to attach to the process before "main" completes.

1
  • No, the breakpoints are not active as indicated by the hollow circles with a yellow warning sign. Commented Sep 29, 2016 at 13:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.