Remote debugging Azure website: Breakpoints not hit

后端 未结 6 1790
余生分开走
余生分开走 2021-01-04 21:48

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 c

相关标签:
6条回答
  • 2021-01-04 22:27

    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.

    0 讨论(0)
  • 2021-01-04 22:37

    I was having this problem with a .Net Core Azure Function project. The following github issue speaks to it, but solution didn't solve my problem:

    https://github.com/Azure/Azure-Functions/issues/872

    I finally stumbled across the answer here:

    http://dontcodetired.com/blog/post/Remote-Debugging-Azure-Functions-V2-The-breakpoint-will-not-currently-be-hit-No-symbols-have-been-loaded-for-this-document

    It boils down to manually attaching to the process in Azure, rather than relying on the Cloud Explorer right-click functionality.

    0 讨论(0)
  • 2021-01-04 22:46

    I ran into this issue a few times.

    I got it fixed by making sure the platform/configuration of my publish profile matched my local build platform/configuration.

    I was publishing Debug | Any CPU, but my local build was using Debug | Mixed Platforms.

    Once I changed my publish configuration to Debug | Mixed Platforms and republished, I was able to attach the remote debugger and the symbols were loaded.

    Verify the symbols are loaded for the assembly you are attempting to set breakpoints in by looking in the Visual Studio 'Modules' window for the namespace/assembly name. (This is after attaching the debugger to the remote process and your VS is in Debug mode.)

    After I did this, breakpoints began working for the remote process from within my local VS instance.

    0 讨论(0)
  • 2021-01-04 22:47

    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.

    0 讨论(0)
  • 2021-01-04 22:47

    After struggling with this for hours, I found a consistent solution. I think the root cause is simply a confusing UI. Try this:

    1. Make sure your Web Job is running
    2. VS 2017 -> View -> Cloud Explorer
    3. Click on the WebJob name in Cloud Explorer then simply wait. After 15s or so, "Attach Debugger" will magically appear in the actions area below. It seems that when you click on the WebJob name, VS2017 has to query the WebJob remotely in Azure to determine if it's both running and if it's possible to perform remote debugging, which takes time. If the answer to both is "yes", then "Attach Debugger" will appear in the UI.

    0 讨论(0)
  • 2021-01-04 22:50

    I wrote a short article what helped me with debugging. Have a look here: Debugging in Azure Cloud

    In a nutshell: Find the correct processes to attach to for worker role and web role. WebRole: WaIISHost.exe, w3wp.exe + conhost(s) WorkerRole: WaWorkerHost.exe + conhost(s)

    0 讨论(0)
提交回复
热议问题