Solved: The Visual Studio 2017 Remote Debugger (MSVSMON.EXE) does not appear to be running

/, Azure Cloud, Cloud Computing, Visual Studio/Solved: The Visual Studio 2017 Remote Debugger (MSVSMON.EXE) does not appear to be running

Solved: The Visual Studio 2017 Remote Debugger (MSVSMON.EXE) does not appear to be running


Errors:

The Visual Studio 2017 Remote Debugger (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing communication to the remote computer

Specific method is not supported

Full Detail:

System.Runtime.InteropServices.COMException (0x89710023): Unable to connect to the Microsoft Visual Studio Remote Debugger named ‘scientistzwebapp.azurewebsites.net’. The Visual Studio 2017 Remote Debugger (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing communication to the remote computer. Please see Help for assistance on configuring remote debugging.

at Microsoft.VisualStudio.Debugger.Interop.Internal.IDebuggerInternal120.ConnectToServer(String szServerName, VsDebugRemoteConnectOptions[] pConnectOptions, CONNECT_REASON ConnectReason, Int32 fIncrementUsageCount, IDebugCoreServer3& ppServer)

at Microsoft.VisualStudio.Web.Azure.MicrosoftWeb.Operations.RemoteDiagnosticsSessionBase.ConnectToServer(String site, String user, String password)

When it Happen:

If you are using Azure App Service for your application development or deployment, there are some time when you need to debug the solution, Azure provide you the feature of remote debugging. All you need to do is to Attach Debugger and Visual Studio will take care the rest for you.

Figure 1 Remote Debugging on Azure App Service

Sometimes you are not so lucky, and get the error like below:

Figure 2 The Visual Studio 2017 Remote Debugger (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing communication to the remote computer

Figure 3 Specific method is not supported.

Solutions:

  1. First, you need to check if you have appropriate permissions on the Web App to do the debugging.
  2. Manually enable the debugging on Web App and try again for debugging.

Figure 4 enable Debugging on the App Service

  1. Make sure that you have published the files in debug mode.

Figure 5 Publish web app in debug mode

  1. Make sure that you are debugging in the right CPU configuration for platform is either x86 or x64, check both on Azure and Visual studio and Match the configuration.

Figure 6 Platform setting

Project | Properties | Build | Platform target

Figure 7 Visual Studio debug Platform target

  1. If you are still getting the issue, this mean there is some firewall or system setting, which is blocking your connection to the debugging service. In order to make sure, let us use Microsoft tool TCPView. When you run this tool and try to remote debug, you will see that devenv.exe (visual studio process name) is trying to connect on port 4022 to Azure IP Address but could not send any packets. This is our problem, all we need to do is to enable this port in our firewall as outgoing and debugging will work just fine.

Figure 8 TCPview to get the Process port communication

Different versions of visual studio have different ports and if you debugging in x64 mode VS2017 will use 4022 and if you are debugging in x86 then VS2017 will use 4023.

Please find below table to find out appropriate port to open in firewall.

https://docs.microsoft.com/en-us/visualstudio/debugger/remote-debugger-port-assignments

VersionX64X86
Visual Studio 201740224023
Visual Studio 201540204021
Visual Studio 201340184019
Visual Studio 201240164020

In addition to this, we need to open

VersionPort
Remote Debugger Discovery3702

More information on windows firewall configuration https://docs.microsoft.com/en-us/visualstudio/debugger/configure-the-windows-firewall-for-remote-debugging

If you are looking for more resources check below link:

https://docs.microsoft.com/en-us/azure/app-service/web-sites-dotnet-troubleshoot-visual-studio

By |2018-10-11T09:32:49+00:00January 16th, 2018|Azure App Service, Azure Cloud, Cloud Computing, Visual Studio|0 Comments

About the Author:

Leave A Comment