Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 Remote Debugging: Invalid access to memory location

I followed the instructions in this link: http://msdn.microsoft.com/en-us/library/bt727f1t.aspx to install the remote debugger (2012) on my server where the application is running in hope to debug it remotely from my dev machine running visual studio 2012.

I cannot even get as far as viewing the list of processes to attach to on the remote machine. I keep getting "Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor named [name]. Invalid access to memory location".

I have managed to successfully connect a few times but then the attach fails immediately then I cannot connect again.

This is causing huge issues for me as I cannot remote debug anything. I must be missing something glaring. Please someone give me a solution.

like image 884
Shumii Avatar asked Dec 14 '12 12:12

Shumii


People also ask

How do I debug a remote code in Visual Studio?

Set a breakpoint on the line you want to inspect in the debugger. The declaration of the PORT variable is an excellent place to start. Next, go to the Run and Debug menu in the sidebar and select Run script: start. This will execute the application in the remote environment and attach the Node debugger.

How do I disable remote debugging in Visual Studio?

05 On the General settings panel, under Debugging, select Off next to Remote debugging setting to disable remote debugging using Microsoft Visual Studio for the selected Azure App Services web application. Click Save to apply the changes.


2 Answers

I've found the only way to correct this is by restarting Visual Studio.

Worked for me. I found it at this blog post about invalid access and remote debugging.

like image 80
Vladimir Avatar answered Oct 19 '22 02:10

Vladimir


It turns out the one thing I missed was to tell Visual Studio where to find the .pdb symbols relating to the remote process. To do this go to Tools -> Options -> Debugging then in the Symbol (.pdb) locations add the remote location to the pdb files.

To clarify, I was attaching fine but could not break into code. Now I can. Be aware though that there are other hurdles before you get to my stage where I was attaching to the process successfully but could not catch a breakpoint.

like image 39
Shumii Avatar answered Oct 19 '22 02:10

Shumii