远程调试 Web 服务时出现问题

发布于 2024-11-09 18:10:07 字数 734 浏览 6 评论 0原文

我在 Google 和 StackOverflow 上多次发现这个问题,但没有一个能回答我的情况。

我正在尝试远程调试 Web 服务,远程调试设置正确,我已经部署了最新版本(以及 pdb 文件)并将调试器附加到远程计算机上的 w3wp 进程。但是,一旦附加,我的所有断点都会自动禁用(当前不会命中断点。尚未为此文档加载任何符号)。有谁知道我做错了什么?

到目前为止,我已尝试以下操作:

  • 在高级编译选项中将“生成调试信息”设置为“完整”。
  • 在高级编译选项中将“启用优化”设置为“False”。
  • 在“模块”窗口中,符号状态为“跳过加载符号”
    • 尝试手动加载符号
    • 尝试将符号设置中的符号文件位置更改为远程 pdb 文件
  • 清理并在部署之前重建解决方案
  • 我尝试在调试选项中取消选中“仅我的代码”,这似乎解决了问题,但是当我调用了网络服务,没有遇到断点。
  • 这个网站看起来很有希望,但对end
  • pdb 已打开远程机器

I've found this question many times on Google and on StackOverflow, though none answer my scenario.

I'm trying to remotely debug a web service, remote debugging is set up correctly, I've deployed the latest build (along with pdb files) and attached the debugger to the w3wp process on the remote machine. Once attached however, all of my break points are automatically disabled (Breakpoint will not currently be hit. No symbols have been loaded for this document). Does anyone know what I am doing wrong?

I've tried the following so far:

  • set 'Generate Debug Information' to 'FULL' in advanced compile options.
  • set 'Enable Optimisations' to 'False' in advanced compile options.
  • In the Modules window the symbol status is 'Skipped loading symbols
    • tried loading symbols manually
    • tried changing symbol file locations in symbol settings to the remote pdb file
  • cleaned and rebuild the solution before deployment
  • I tried unchecking 'Just My Code' in the debugging options, that appeared to solve the problem, but when I called the web service, no break points were hit.
  • This site looked promising, but didn't help in the end
  • the pdb is on the remote machine

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

无言温柔 2024-11-16 18:10:07

经过一番折腾后,我似乎已经实现了我想要的:

  • 在高级编译选项中
    • 将“生成调试信息”设置为“完整”。
    • 将“启用优化”设置为“False”。
  • 确保符号设置中的符号文件位置(调试 - 模块窗口)指向正确的位置
    • 我将远程位置和本地位置添加到 .pdb 位置
  • 已清理的 .pdb 位置并在部署之前重建解决方案

After much messing around I seemed to have achived what I wanted:

  • in advanced compile options
    • set 'Generate Debug Information' to 'FULL'.
    • set 'Enable Optimisations' to 'False'.
  • Ensure symbol file locations (debug - modules window) in symbol settings point to the correct location
    • I added the remote location and the local location to the .pdb locations
  • cleaned and rebuild the solution before deployment
二智少女猫性小仙女 2024-11-16 18:10:07

我从来没有找到一个可靠的方法来让它工作。当尝试调试 IIS 中托管的 WCF 服务时,一遍又一遍地遵循相同的过程(重新构建、部署、重新启动站点、附加),有时会加载符号,有时则不会。

就我而言,这取决于在我部署后有人向站点发出请求之前我是否附加到该进程(进而导致 IIS 编译并执行其奇怪的操作)。

我发现,如果我按照以下步骤操作,它对我有用:

  1. 重建解决方案
  2. 部署到远程服务器
  3. 重新启动 IIS - 我怀疑这是必要的,我确信重新启动应用程序池就足够了
  4. 找到工作进程并附加到它 -
    此时断点将被禁用,这很好
  5. 从网站请求一些东西 -
    我只是使用浏览器完成了此操作。这导致 IIS 编译我的应用程序。通过在编译之前附加 VS,我发现我正在加载符号(至少比以前更频繁)

也许同样的过程对您有用?

I've never found a sure fire way to get this to work. When attempting to debug a WCF service hosted in IIS, following the same process over and over (ReBuild, Deploy, Restart Site, Attach) I would sometimes have the symbols loaded, sometimes not.

In my case, it came down to whether I attached to the process before somebody made a request against the site after I had deployed (in turn causing IIS to compile and do its funky stuff).

I found that if I followed these steps, it worked for me:

  1. Rebuild Solution
  2. Deploy to Remote Server
  3. Restart IIS - I doubt this is necessary, restarting the app pool would suffice I'm sure
  4. Locate the Worker Process and Attach to it -
    Breakpoints will be disabled at this point, that was fine
  5. Request something from the site -
    I did this just using a browser. This caused IIS to compile my app. By having VS attached prior to this compile, I found I was getting the symbols loaded (at least much more often than before).

Maybe the same process will work for you?

我的鱼塘能养鲲 2024-11-16 18:10:07

就我而言,我已将 pdb 部署到 iis 工作进程路径,因此一切都应该很好,而且我真的不明白为什么会出现“跳过加载符号”。
我真的觉得它只是没有心情(没有理性的原因)。

所以我右键单击了我感兴趣的调试dll(也可以选择多个文件),
并选择“加载符号自”>符号路径

并导致它们被加载。

然后我就可以调试它了。谢谢!

In my case, I had the pdb's deployed to the iis worker process path, so all was supposed to be good, and I really couldn't see why "Skipped loading symbols" was appearing.
I really got the impression it just was not in the mood (no rational reason).

So i right clicked on the dll I was interested in debugging (can select multiple files also),
and chose Load Symbols From > Symbol Path

and that caused them to be loaded.

Then I could debug it. Thanks!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文