41

I'm running Visual Studio 2012 on Windows 8 64bit. I have a 64 bit project that is in source control and I'm trying to run it at home on my Windows 8 pc. The application builds successfully however the remote debugger doesn't work at all.

It says "A remote operation is taking longer than expected". I understand why its remote, being that 32 bit Visual Studio needs to access msvsmon.exe to debug through 64 bit applications but I've never seen this happen on a local machine where the source code has been checked out.

I tried reinstalling Visual Studio 2012, playing with ports (4016) as well as running as admin. Checked that VPN wasn't an issue by uninstalling the client.

I am now out of ideas. I tried creating a brand new local project to test and set it as 64 bit but the operation still does not succeed.

Any ideas or suggestions? Is this a known issue with Visual Studio 2012 on Windows 8?

bl4kh4k
  • 1,440
  • 4
  • 20
  • 34

7 Answers7

93

I think you should try this:

  • Run cmd.exe as administrator.
  • Type in and run the following two lines of command:

netsh winsock reset catalog

netsh int ip reset reset.log hit

  • It may say that a reboot is required, but actually that is not necessary.
  • Try to debug your application again, the problem should be solved.

EDIT: Sorry for not providing an explanation for this before. The answer actually came from a Chinese forum and the original author didn't explain it much. But he did say that it's because Visual Studio is a 32bit program which may have problem accessing network under 64bit Windows 7, and the aforementioned solution resets the network connection therefore solves the problem.

starball
  • 20,030
  • 7
  • 43
  • 238
Adam Liu
  • 1,083
  • 7
  • 12
  • I had to re-enter my machine's IP address, but this worked. Thank you Very Much. I've spent Hours trying to figure out why VS2012 wanted to access a network to run a program in IDE mode and couldn't but everything else got to the net just fine. – CurtTampa Jul 04 '13 at 14:42
  • 3
    It worked for me. But i would really appreciate an explanation about the solution. – Md Ashaduzzaman Sep 22 '13 at 23:58
  • @Adam : Pretty good Answer, But without "How did it work ?" Answer it will Downrate. -1 for now , Once you find time to Reply to this Will again Upvote. – bhuvin Feb 04 '14 at 06:40
  • Sorry for not providing an explanation for this before. The answer actually came from a Chinese forum and the original author didn't explain it much. But he did say that it's because Visual Studio is a 32bit program which may have problem accessing network under 64bit Windows 7, and the aforementioned solution resets the network connection therefore solves the problem. Hope this helps. – Adam Liu Feb 07 '14 at 03:55
  • Doing SharePoint debugging on SharePoint 2010 with Visual Studio 2012 and this issue struck me for some unknown reason. The two netsh commands worked for me. But unlike the note that a reboot was not necessary, it turned out to only work for me until after the reboot. – Talbott Crowell Mar 29 '14 at 13:00
  • 3
    Be aware that these commands will reset VMWare network settings. This may result in your guest system not being reachable from the host. – Ingweland Oct 04 '14 at 20:15
  • This hasn't been marked as an answer, but it solved the issue for me even with Visual Studio 2013. – rhughes Feb 14 '15 at 19:53
  • Adam Liu, your solution is resolved my problem. but, it is always when I tried to debug the application and I have to perform steps provided in your answer. So you have any idea why is it coming again and again? – Geeky Ninja Jun 17 '15 at 12:46
  • Solved my issue - Thanks! – shug Jul 27 '15 at 03:01
  • Not 100% sure yet but I think this may have solved my issue – JohnL Feb 21 '19 at 10:17
  • Machine suddenly started being unable to terminate a simple 64-bit app in visual studio 2015. Even after a restart. This fixed it. Thanks! – aggieNick02 Apr 04 '19 at 19:54
  • @AdamLiu Thank you for sharing this. I was struggling with the same issue for about a year. This solution resolved my issue. – nam Nov 16 '20 at 17:37
  • Definitely, there is some improvement. Thanks, mate. – Hari Nov 08 '22 at 13:19
3

The only answer I have gotten to work with VS2012 is to go into the Project properties > Compile > Target CPU and set the option to "x86".

This also seems related to this question: Can't start debugger in VS2012 RC They submitted this to Microsoft Connect as well. Seems to be a Visual Studio problem...

best of luck.

Community
  • 1
  • 1
Watki02
  • 4,696
  • 7
  • 34
  • 36
  • This does not help me unfortunately... Neither does any of the solutions in the CS2012 RC thread. – mikeesouth Jan 29 '13 at 22:40
  • This worked for me thanks. actually I have Windows 7 64bit with vs 2012. When I set it to x86 from Any CPU it worked. in 32bit OS vs2012 working fine on AnyCPU but in 64bit OS i need to explicitly set the targeted OS. – Zeeshanef Mar 31 '14 at 08:47
3

I am working with VS2012 (Windows7, 64-bit PC). When I selected DEBUG - Attach to Process... I did see a messagebox saying "A 64-bit debugging operation is taking longer than expected". I downloaded I free trial version of VS2010 and noticed that in VS2010 it worked fine. So, I copied the files msvsmon.exe and msvsmon.exe.config from VS2010 (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x64 and C:\ ... \x86) into the same maps in VS2012. Now it is working VS2012. Hope this helps you too. Good luck.

Peter Vos
  • 31
  • 2
2

Just my two cents,

I have experienced this issue twice now and it turns out after all of the suggestions I tried, it was BitDefender on my local machine that was doing this. So my fix for this problem is to try adding in exceptions to the local security software into the firewall and AV parts of it. Tell it to ignore the msvsmon.exe and devenv.exe altogether and see what difference that makes.

Otherwise try ripping it off altogether and see if the it lets you debug your solution.

You can see here for more info: http://forum.bitdefender.com/index.php?showtopic=37028

I installed the latest BitDefender version and all was fine for me.

IbrarMumtaz
  • 4,235
  • 7
  • 44
  • 63
0

Solution for me in VS 2015. I had a public dns entry mapped to my local iis and the web/debug tab of the project:

<app>.<domain>.co.uk

Just had to add that to the hosts file as a local host:

127.0.0.1 <app>.<domain>.co.uk

Thus VS no longer thinks the host is a remote machine.

jenson-button-event
  • 18,101
  • 11
  • 89
  • 155
-2

The solution to this problem is:

Navigate to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger Open x64 folder and rename the msvsmon.exe file to msvsmon_old.exe Now, navigate to x86 folder and copy msvsmon.exe and paste it into x64 folder. Restart the Visusl Studio 2012 IDE, and now try attching to process during debugging

Saroop Trivedi
  • 2,245
  • 6
  • 31
  • 49
  • 3
    While it will resolve the issue in a way, I think this means you're replacing the 64bit debugger with a 32-bit one, and not addressing the core problem that the 64-bit debugger was unable to connect. The network reset proposed by Adam Liu addresses the core networking issue instead, and lets you keep the 64-bit debugger, so seems by far the wiser course. – Dewi Morgan Jun 29 '15 at 17:10
-3

What worked for me was uninstalling a program called "sendori"