'What could cause "Debugging will be aborted" error in Visual Studio 2008?

From time to time I get the following error when starting the debugger in Visual Studio 2008 SP1:

The network connection to MYCOMPUTER has been lost. Debugging will be aborted.

I have several projects in the solution configured as startup projects. Some of them get started when the error occurs, some won't.

Any ideas?

Update:
- Visual Studio runs on a 64 bit machine (Win7)
- The application uses MSMQ (private queues on localhost)



Solution 1:[1]

What's likely happening here is that you are using remote debugging on your application. Some error during startup is causing that error message.

Can you give us a bit more information on the applications.

  • Are you expilictly using remote debuggging?
  • Are their any resources being used on MYCOMPUTER via some remote operation?
  • Are you runnig projects off of a share?

You may be implicitly using remote debugging if you are debugging a 64 bit appliction. Visual Studio runs as a 32 bit process and uses remote debugging under the hood to debug 64 bit applications.

Solution 2:[2]

The fix for me was deleting all my breakpoints. Evidently, an update from source control corrupted some pre-existing breakpoints.

Solution 3:[3]

For anyone stumbling on this post, I fixed this problem in Visual Studio 2015 by uninstalling Agents for Visual Studio 2015 on the remote machine.

For some reason it conflicted with the remote debugging process but I couldn't figure out why exacly. I found this by meticulously comparing a working remote machine with one that gave me the error and fixing every difference that I could find.

Solution 4:[4]

Check debug properties on your startup projects, there might be remote debugging configured. (Debugging/Remote settings)

Solution 5:[5]

Disable "Use Managed Compatibility Mode" option in Tools - Options - Debugging. It solved this problem in my case.

Solution 6:[6]

Add powershell rule as Admin. (You may need to change the file path to match)

New-NetFirewallRule -DisplayName "msvsmon" -Direction Inbound -Program "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Remote Debugger\x64\msvsmon.exe" -LocalPort 4026 -Protocol TCP -Authentication Required -Action Allow

Other stuff I did:

  • add the following to your hosts file in C:\Windows\System32\drivers\etc

127.0.0.1:4026 YourComputerName # hostname 127.0.0.1:4026 localhost

More stuff I had to do:

  • open C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Remote Debugger\x64\msvsmon.exe
  • check if the port is 4026 and also click on the Permissions button and see if the Admin and Yourself have permission to debug
  • also open C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Remote Debugger\x86\msvsmon.exe and see if the port is 4026, also check Permission to debug
  • Since I'm using HitmanPro antimalware/antiransomware software, I added all the *msvsmon.exe and main Visual Studio executables to the exceptions including the services (*msvsmon.exe files which don't have a UI). I also added the entire Visual Studio Install Folder to Windows Security as an exception. Therefore make sure you add these locations and files to your relevant antivirus, antimalware, antiransomware programs as well.

Almost gave up... but never do that... spent 3 days figuring this out and yet MS has pages and pages of stuff that will just probably confuse you.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 JaredPar
Solution 2 ShawnFeatherly
Solution 3 Bobsleigh
Solution 4 Eugene
Solution 5 Maksim Iakovlev
Solution 6