Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote debugging Azure website: Breakpoints not hit

I've got an ASP.NET website that I deployed to Azure. I'm using VS2013, .NET 4.5.1 and Azure SDK 2.2. I turned on remote debugging for VS2013 in the management portal. I can successfully right click the website under the "Azure" node in servers, and select "Attach debugger." It says that it is downloading debugging settings, and then the web browser comes up. But breakpoints are never hit despite them being in code that I know is executed. One clue: the breakpoint has an open circle and states: "The breakpoint will not currently be hit. No symbols have been loaded for this document." But the breakpoint works fine when testing locally. Does anyone have any thoughts on how to address this?

Thanks...

-Ben

Update: I dropped from .NET 4.5.1 to 4.5; problem persists.

like image 287
BenjiFB Avatar asked Mar 19 '14 16:03

BenjiFB


2 Answers

Make sure you publish a debug build to a specific deployment slot. I had this same problem and when I attached the remote debugger to my staging slot that had a debug build deployed there, it worked. Trying to debug a release build doesn't work because the requisite debug symbols are not present. Like @Lars explains above, I had to restart the web app on Azure and then try the debug again against the debug build.

like image 95
CrusherJoe Avatar answered Oct 16 '22 07:10

CrusherJoe


I also struggled with this (VS2015 Enterprise) but found a solution that works pretty consistently.

  • Make sure you aren't attached to the web app
  • Open up the Azure portal for the web app
  • Stop the web app
  • Restart the web app
  • Give it a second to warm up, then go back to VS and re-attach

This works for me almost every time. Note that stopping and starting the web app from w/in Visual Studio does not work consistently.

like image 38
Lars Avatar answered Oct 16 '22 07:10

Lars