visual studio 2017 remote debugging azure api app: “The breakpoint will not currently be hit. No symbols have been loaded for this document.”

痞子三分冷 提交于 2019-12-13 03:27:42

问题


I'm trying to remote debug an asp.net core 1.1 api app (targeting .net framework 4.5.2) that's running on Azure.
I attach the debugger via Server Explorer. The debugger attaches to the correct process. But any breakpoint I set has the message "The breakpoint will not currently be hit. No symbols have been loaded for this document."
All answers I've seen to such a problem assume that the modules window shows all modules loaded by my project, but in my case the modules window is empty!
I'm on VS2017 15.4.
If I remember correctly, I was previously able to remote debug the same project with version 15.2. The problem started occurring when I updated to 15.3 but I didn't pursue it at the time.


回答1:


I submitted the problem on the MS forums: Can't remote debug Azure API app

and now I have received an official reply that it is indeed a bug in VS, and a fix will be available in the pending release (15.6).

They also suggested a workaround, which I tried and indeed worked: Manually Attach a Debugger to Azure Web Apps

Which involves:

  1. Going to the web app Application settings in the Azure portal, and making sure that Remote debugging is enabled,
  2. In the VS menu: Debug > Attach to Process..., entering the web app url with the debugging port, e.g.:

    myapp.azurewebsites.net:4022  
    
  3. Then in the credentials that appears, entering the username & password that are available in the app's Publish Profile, which can be downloaded from the portal. If the username is $myapp, it should be entered like this:

    $myappp\$myapp  
    
  4. Then choosing Managed(v4.6, v4.5, v4.0) code and then the name of the Core app.

Actually, I had found and unsuccessfully tried similar approaches before. The key for me was step 3. The others had suggested entering the username as .\$myapp, or myapp\$myapp. So make sure to enter it as written above.

BTW, seeing that the above blog post is from almost 2 years ago (Feb 2016), whereas the problem I'm experiencing was introduced only a few months ago, it seems to be a cure-all, and it is therefore worthwhile, for anyone who has to deal with remote debugging Azure apps, to save this information for future reference.

UPDATE: After updating VS 2017 to version 15.5.2 the problem seems to have been fixed.



来源:https://stackoverflow.com/questions/46764732/visual-studio-2017-remote-debugging-azure-api-app-the-breakpoint-will-not-curr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!