Azure: Cannot connect to remote debugger - debugging

I want to use Remote Debugger in Visual Studio 2015 to attach to my site. When I try "Attach Debugger" the azure return:
The following error occurred while launching remote debugging: Unable to connect to the Microsoft Visual Studio Remote Debugger name 'XXXX'. Windows authentication was unable to establish a secure connection to the remote computer.
In azure portal I set remote debugging and select VS 2015.

These errors might be related to Local Policies > Security Options > Network Security: LAN manager authentication level. It needs to be set to “Send NTLMV2 response only”. Once this is set then the PC was able to open RemoteApp applications without problems.
To set local policies go to command prompt and type secpol.msc or Administrative Tools > Local Security Policy

Maybe your application is not enabled to use remote debugger.
To enable remote debugger in app service:
Go to Azure management portal
Select your app
Go to settings
Go to Debugging
Enable Remote Debugging
Select your visual studio debugger versión

As much as it pains me to provide this as a solution, have you tried closing and re-opening Visual Studio? (In particular if you were able to connect at one point and it stopped working.) This has solved this issue for me on multiple occasions.

Changing my network connection appeared to solve this for me. To do this, I:
Open Networking and Sharing Center
Change adapter settings
Disable the currently-active network adapter (ethernet in my case)
Enable another network adapter (WiFi in my case)
After that, Visual Studio debugged the app service.

Related

Can Visual Studio remote debugging be done over a local network?

I've been unable to get Visual Studio, running on my development machine, to successfully deploy to a Surface Book on my local network. Error message is included below. On the Surface Book I've installed Remote Tools for Visual Studio, and set up Developer Mode. VS on my development machine shows me the SB, and allows me to select if from a list of deployment targets, including it's Authentication type, but deployment fails.
There is a "pair" option on the SB, which I haven't been able to make work & I'm not sure if it's necessary. In addition, I saw a post saying this option (local network) was no longer supported. Is it still supported, and if so, any idea what I'm doing wrong?
Error Message:
Error DEP6957: Failed to connect to device '10.0.0.179' using Universal Authentication. Please verify the correct remote authentication mode is specified in the project debug settings. COMException - Error HRESULT E_FAIL has been returned from a call to a COM component. [0x80004005]
To remote debug a uwp app, we should install the corresponding version Remote Tools for Visual Studio, before we can deploy the app to the remote device, we should configure the Remote Debugger tool. See the Run UWP apps on a remote machine in Visual Studio for details.
For your this issue, it should be you select the Windows authentication mode in your Visual Studio as the follow image, but you don't have access to the credentials of the signed-in user of the target machine. In your VS, you should use the credentials of the signed-in user of the target machine to deploy your app when the VS popup the permission window. See the Authentication modes to learn the differences.
On the other hand, you can also try to use the None authentication mode to remote deploy your app as the following steps.
Firstly, in the Visual Studio Remote Debugger of the target device, select Tools=> Options to configure the options Window as bellow,
Then in your Visual studio, right click your UWP project=> properties=> Debug to cofigure it as None authentication mode.
The answer from Breeze Liu was very helpful, and got me most of the way to the solution. The final step that I was missing was to add my account to the Remote Debugger's permission list. It's found at Remote Debugger>Tools>Permissions. I had to add my account on the target machine to the list of "permitted" debuggers.

Remote Debugging of Azure Web Application

I'm currently using visual studio 2017 and trying to attach the debugger to my web app. I've deployed my app and i've attached the debugger through VS. I've also ensure on the azure portal that remote debugger is turned on. I've also went to https://xxxxxxxx.scm.azurewebsites.net/ and checked the processes and w3wp is available. From Unable to start debugging in VS2015 for Azure web app and Remote Debugging - Web App Azure it indicated to me it could be a port being blocked. so i went ahead and set my firewall outbound to allow the connections from UDP 3702 TCP 4020 TCP 4021 and ports 4022 and the problem still persist. I'm unable to connect to my connection target.
I've tried xxxxxxxxx.azurewebsites.net:4022 and xxxxxxxxx.azurewebsites.net
I'm all out of ideas and suggestions from the web. If anyone else has tips, that'll be great.
unable to connect to my connection target.
Please refer to this article to configure the firewall to enable remote debugging for VS 2017.
Remote debugging works for me using VS 2017 with following steps:
Turn on Remote debugging and choose VS 2017
Find and attach to process
Please try to enter {your_web_app_name}.azurewebsites.net:4022 and click Refresh button to check if you can see available processes.
Besides, you can right-click your web app, and then click Attach Debugger to remote debug the web app in Server Explorer.
Updates:
Get publish profile on portal

remote debugging in visual studio cannot connect

Hello i have a problem with remote debugging in Visual Studio (v12)
I Created windows azure account i published application to the cloud.
Then i connected to this account through remote desktop. Address of remote computer is f.e Iron.app.net
Then i downloaded there and run remote debugger. I started msvsmon.exe and it created server named:
RD0015555E2:555
And now i would like to remote debugging in my host.
i know i must attach to process. And i do it.
From Visual Studio: Debug->attach to process->Qualifier:RD0015555E2 and it cannot resolve host name.
i also tried Iron.app.net but then it shows error that it seems that msvsmon is not installed.
I dont know what should i type into Qualifier (as remote machine)?
Remote debugging is tricky to configure Windows Azure Cloud Services. Other options that you have are:
Intellitrace (in case you've got Visual Studio Ultimate)
Intensive (verbose) pro-active code instrumentation (logging) from the beginning.
Profiling Cloud Service
Chose either, and watch your logs/traces.
Or deep dive into Remote Debugging Cloud Services. I would, however use Remote Debugging as a final option, when everything else does not work and does not help me. Typically most of the issues that would pop in the cloud will also pop in when debugging locally. And if role is just recycling, you will not be able to attach debugger at all.

Attach to Remote C++ Process with Visual Studio 2010

I have a c++ program running on a remote machine.
I'd like to debug it from my machine.
I've installed remote debugging services (msvsmon.exe ) on the server.
Firewalls are not active not in the client nor in the server.
The program is running on the server (.pdb file is also there).
In the client I open the project in VS2010 , I go to debug->attach to process.
In the qualifier field I copy the value of the server name in msvsmon.exe.
When I hit enter, I get an error prompt saying :
"Unable to connect to Microsoft Visual Studio Remote Debugging Monitor named Administrator#TESTER1, the requested name is valid, but no data of the requested type was found"
In the server, the Authentication mode in msvsmon.exe is set to Windows Authentication.
Any help will be much appreciated.
Regards,
Omer.
Take a look at:
How to: Set Up Remote Debugging from Microsoft
Remote debugging with Visual Studio 2010 from CodeProject
In your case, take note of the suggestions regarding native debugging and windows authentication.
In my experiences with remote debugging a machine that is on my local network, I bypass windows authentication and setup the remote msvsmon.exe to allow anyone to connect to port 4015. So, then in the 'Attach to Process' dialog I select Transport > Remote (Native only with no authentication) and for the Qualifier I enter TESTER1:4015 or TheIPAddress:4015 if the name of the PC cannot be resolved.

Remote Debugging in VS2010 - access denied

I have VS2010 on my dev machine (Win7) and I run a virtual machine under XP SP3 (name PC), on which I installed the VS2010 remote debugger, as well as .Net Framework 4.
On both OS I have the same user name (User), with the same password, with admin privilege, who is allowed to debug programs (Local Policy/User Rights Assignment/Debug programs). The firewall is deactivated on both.
When I debug my program through VS2010 (specifying "Start external program" and "Use remote machine"), I get
Error while trying to run project: Unable to start debugging.
Access is denied. Can not connect to Microsoft Visual Studio Remote
Debugging Monitor on the remote computer.
On the VM the Visual Studio Remote Debugging Monitor displays a line saying "PC\User connected".
If I try to attach a process using "Default" as transport and "User#PC" as qualifier, I get a similar error
Unable to connect to the Microsoft Visual Studio Remote Debugging
Monitor named 'User#PC'. Access is denied. Can not connect to
Microsoft Visual Studio Remote Debugging Monitor on the remote
computer.
Again on the VM the Visual Studio Remote Debugging Monitor displays a line saying "PC\User connected".
If I try to attach a process using "Remote (Native only with no authentication)" as transport and "PC:4015" as qualifier (changing the "Authentication mode" to "No Authentication (native only)", then it works and I see all the available processes on the VM.
Any idea on why the access is denied even if the Visual Studio Remote Debugging Monitor seems to accept the connection? Also if I 1st use "Windows Authentication" and try to start the debugger, and then I try to change the "Authentication mode" to "No Authentication", I get
Your new options can not be applied. Cannot stop server because one or
more users are currently connected.
View Msvsmon's help for more information.
I was eventually able to make it work by doing "Run as administrator" on VS.Net 2010 (I forgot that Windows 2008 and 7 are quite different when it comes to right management).

Resources