且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

visual studio 2017远程调试azure api应用程序:“当前不会命中断点。没有为该文档加载任何符号。

更新时间:2023-11-06 14:25:34

我在MS论坛上提交了问题:无法远程调试Azure API应用

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

现在我已经收到正式答复,它确实是VS中的错误,并且即将发布的版本(15.6)中将提供修复程序。

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).

还提出了一种解决方法,我尝试过并且确实可行:手动将调试器附加到Azure Web Apps

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

涉及的内容:


  1. 转到Web应用程序Azure门户中的应用程序设置,并确保启用了远程调试,
  1. Going to the web app Application settings in the Azure portal, and making sure that Remote debugging is enabled,

在 VS菜单中:调试>附加到进程...,使用调试端口输入Web应用程序的URL,例如:

In the VS menu: Debug > Attach to Process..., entering the web app url with the debugging port, e.g.:

myapp.azurewebsites.net:4022  


  • 然后在显示的凭据中输入用户名&该应用程序的发布个人资料中提供的密码,可以从门户网站下载该密码。如果用户名是$ myapp,则应这样输入:

  • 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  
    


  • 然后选择Managed(v4.6,v4.5,v4.0)代码,然后选择Core名称应用程序。

  • Then choosing Managed(v4.6, v4.5, v4.0) code and then the name of the Core app.

    实际上,我之前发现并尝试了类似的方法,但均未成功。对我来说,关键是步骤3。其他人建议输入用户名.my $ myapp或myapp\ $ myapp。因此,请确保按上面的文字输入。

    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,看到以上博客文章来自大约2年前(2016年2月),而我的问题是体验只是在几个月前才推出的,它似乎可以解决所有问题,因此对于必须处理远程调试Azure应用程序的任何人来说,保存此信息以供将来参考都是值得的。

    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.

    更新:
    将VS 2017更新到15.5.2版后,问题似乎已解决。

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