Visual Studio 2012 Remote Debugging: Invalid access to memory location
Asked Answered
R

4

32

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.

Ridicule answered 14/12, 2012 at 12:33 Comment(0)
R
14

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.

Ridicule answered 12/7, 2013 at 9:0 Comment(2)
FYI, I was having the same issue. I went into TOOLS -> OPTIONS -> DEBUGGING -> SYMBOLS and clicked the LOAD ALL SYMBOLS button. VS created a cache location and downloaded several files, but it started working. Thanks for pointing me in the right direction!Bernadine
Thank you both for this - I had to add the bin directory on the remote server, then click 'Load All Symbols'.Irritated
D
55

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.

Defiance answered 31/1, 2013 at 7:42 Comment(4)
Works here. Frustrated that that's the fix - although I'm not too surprised.Jargonize
You can install a hotfix as suggested in Gregg's answer (https://mcmap.net/q/340723/-visual-studio-2012-remote-debugging-invalid-access-to-memory-location) instead of restarting VS over and over.Tieck
@Defiance - Link is broken.Weaver
@pil0t, may I ask you to have a look at a remote-debugging related question here : tinyurl.com/ovglq92 ?Faa
R
14

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.

Ridicule answered 12/7, 2013 at 9:0 Comment(2)
FYI, I was having the same issue. I went into TOOLS -> OPTIONS -> DEBUGGING -> SYMBOLS and clicked the LOAD ALL SYMBOLS button. VS created a cache location and downloaded several files, but it started working. Thanks for pointing me in the right direction!Bernadine
Thank you both for this - I had to add the bin directory on the remote server, then click 'Load All Symbols'.Irritated
S
13

I recently had someone else report this and debugged the issue on their machine. The "Invalid access to memory location" errors are due to an issue in Windows, it can be addressed with this hotfix.

Shin answered 19/4, 2013 at 15:41 Comment(0)
R
0

I have had this problem in VS 2012, 2013, 2015 and 2017. Based on other answers it is likely that the problem is related to running a 32 bit version of Visual Studio on a 64 bit PC. Sometimes, as others have recommended, restarting Visual Studio fixes the problem but the best solution I've found so far is to start Visual Studio without a solution, open Debug -> Attach to Process, change the Connection Target to the remove server and wait for the process list to load. Then Cancel, do not attach yet. Load your desired solution and then come back to Attach to Process and the remote process list will still be loaded. Connect to your desired process and everything should work properly from then on.

Ravioli answered 24/7, 2017 at 15:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.