Problems debugging web role remote on Microsoft Azure - debugging

I am trying to debug a webservice remote on Microsoft Azure. The service is running in a web role.
I have configured remote debugging in the publish settings an can attach the debugger to the web role. Also, when I have selected the correct process, the debug symbols are loaded correctly and breakpoint's tool tips say that the breakpoint is hosted in "WallSHost.exe" which is the remote process.
What I would like to do, is to run a local client software which I am developing and step into the server code from there. When I step into the according service client call (F11), I get the above error message, saying (for the sake of Google in plain text here):
Unable to automatically step into server. Connecting to the server
machine 'xyz.cloudapp.net' failed. The Microsoft Visual Studio Remote
Debugging Monitor (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.
I have tried to disable the firewall on my (the client) machine with no effect. Has anybody seen that before or can tell me how fix this problem?

A quick checklist
deployed cloud service is a debug build
a debug build is selected from Build Configuration list (in publish wizard)
'Enable Remote Debugger For All Roles' is checked
no changes to code since deployment

Related

Why I can not attach the debugger to App Services running in this subscription?

I'm using Visual Studio 2019. I can attach the debugger to services running in my own subscription.
When I try to attach to services running in another sub from cloud explorer, I get various errors and the attachment never succeeds. The most common is:
Unable to find a process called w3wp with arguments {app service name}. The process may still be starting, please try again.
When trying to attach under the Debug -> Attach to Process dialog, I get the following error:
Unable to connect to {path}. The connection with remote endpoint was
terminated.
I have owner role on the subscription, on the app service and on the app service plan.
Please validate if you have enable debugging from azure platform side. Screen shot od the same from portal looks like:
Also please confirm if you have deploy application from VS.
Visual Studio remote debugging on azure app services used 4020, 4022, 4024 ports for debugging.
https://learn.microsoft.com/en-us/azure/app-service/networking-features#app-service-ports

how to debug app on real domain with using visual studio

I have .NET Framework 4.6.1 app, I know just domain name of staging site "example.com" and have source code.
And I have error on staging but locally it works fine.
So I want to debug app on that domain.
Can I debug app on real domain?
I've tried something with "Attach to Process" but no success.
If I can debug, how can I do that?
Thanks in advance.
Actually, as derpirscher said, you should use Remote debugger to debug your project with that domain.
Make sure that your sever and your PC are under the same network. Then share(copy) the remote debugger folder from VS into the remote domain machine. Run msvsmon.exe on the remote server. And then you can debug the project under the domain sever.
Anyway, to use VS IDE to debug projects on other domain machines, you must ensure that msvsmon.exe(remote debugging tool) is installed and started on the remote machine, that means you must be able to access the domain computer otherwise there is nothing you can do. See this document.
Here is a document about remote debugging a c# app.

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.

Resources