远程调试 Web 服务时出现问题
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
经过一番折腾后,我似乎已经实现了我想要的:
After much messing around I seemed to have achived what I wanted:
我从来没有找到一个可靠的方法来让它工作。当尝试调试 IIS 中托管的 WCF 服务时,一遍又一遍地遵循相同的过程(重新构建、部署、重新启动站点、附加),有时会加载符号,有时则不会。
就我而言,这取决于在我部署后有人向站点发出请求之前我是否附加到该进程(进而导致 IIS 编译并执行其奇怪的操作)。
我发现,如果我按照以下步骤操作,它对我有用:
此时断点将被禁用,这很好
我只是使用浏览器完成了此操作。这导致 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:
Breakpoints will be disabled at this point, that was fine
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?
就我而言,我已将 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!