0

I am trying to debug a deployed service on Azure Cloud by attaching to the process "w3wp.exe".

  1. Set Remote Debugging - On in Azure Cloud.
  2. Debug -> Attach Process -> Connection type: Microsoft Azure App Services -> Login then select the Web App from Cloud -> Select process w3wp
  3. Tools -> Options -> Debugging
  • 'Enable Just My Code' unchecked
    Symbols load, takes 1-2 minutes then an error appears:
System.IO.IOException
  HResult=0x80131620
  Message=Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
  Source=System.Net.Sockets
  StackTrace:
   at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)

Inner Exception 1:
SocketException: The I/O operation has been aborted because of either a thread exit or an application request.
  • 'Enable Just My Code' checked
    Symbols are not loaded. I put a breakpoint on a simple Get method and VS warns me: The breakpoint will not be hit. Symbols have not been loaded for the current document.

Questions:

  1. Do you know how can I debug my remote Azure Web app? What am I doing wrong?
  2. My seniors told me it is no longer possible due to security concerns from Microsoft developers. The remote debugging is now disabled. I don't know if its true.
    Do you know any update on this? Can I still from local Visual Studio 2022 attach to an Azure Cloud Web App and debug on my computer the remote application?
Mihai Socaciu
  • 155
  • 2
  • 12

1 Answers1

0

To debug a deployed service on Azure Cloud by attaching to the process "w3wp.exe",

Steps to debug

  • In Visual Studio, go to Debug -> Attach Process.

enter image description here

  • In the Attach to Process dialog, select Connection type as Microsoft Azure App Services.
  • And click on find and it will prompt to login with your Azure account and select the Web App from Cloud.

enter image description here

enter image description here

  • Select the process w3wp.
  • In Visual Studio, go to Tools -> Options -> Debugging and make sure 'Enable Just My Code' is unchecked.
  • And wait for symbols to load.
  • If you get an error then Enable Just My Code and see if the symbols load.

enter image description here

Debugging code.

enter image description here

  • Run the application with a debug point.
  • Then the debugger hits the breakpoint and allows you to step through the code.

To follow another approach, refer to this SO link.

Rajesh Mopati
  • 1,329
  • 1
  • 2
  • 7
  • The behaviour is still as described in the question. If checkbox is checked or unchecked. If checked the breakpoint is not hit because symbols are not loaded. If unchecked, I get a socket IO exception. – Mihai Socaciu May 11 '23 at 09:25
  • Check this check this [approach-1](https://stackoverflow.com/questions/70713964/visual-studio-2022-debug-azure-app-service/70737737#70737737) and [approach-2.](https://stackoverflow.com/questions/76222026/azure-remote-debugging-in-vs-with-scaled-out-application/76226638#76226638) – Rajesh Mopati May 11 '23 at 10:50