尽管包含 PDB 文件,堆栈跟踪中仍缺少行号
这让我抓狂。我使用 VS 2008 通过 C# 实现了此 Web 服务。我将其发布在 IIS 上。我修改了发布版本,以便将 pdb 文件与 dll 一起复制到 inetpub 上的目标目录中。
web.config 文件也有 debug=true。
然后我调用一个抛出异常的 Web 服务。堆栈跟踪不包含行号。我不知道我在这里缺少什么,有什么想法吗?
其他信息: 如果我使用 VS 内置 Web 服务器运行 Web 应用程序,它就会工作,并且我会在堆栈跟踪中获取行号。但是,如果我将 VS 内置 Web 服务器正在使用的相同文件(pdb 和 dll)复制到 IIS,堆栈跟踪中仍然缺少行号。
似乎有与 IIS 有关的东西忽略了 pdb 文件!
更新 当我发布到 IIS 时,所有 pdb 文件都发布在 bin 目录下,一切看起来都很好。但是当我转到与我的项目相关的特定目录下的“C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files”时,我可以看到程序集(.dll)文件都在那里,但没有 pdb 文件。 但如果我使用 VS 内置 Web 服务器运行该项目,则不会发生这种情况。 因此,如果我手动将 pdb 文件复制到临时文件夹,我可以看到行号。
知道为什么 pdb 文件没有复制到临时文件夹吗?
顺便说一句,当我附加到工作进程时,我可以看到它说符号已加载!
This is running me nuts. I have this web service implemented w/ C# using VS 2008. I publish it on IIS. I have modified the release build so the pdb files are copied along with the dlls into the target directory on inetpub.
Also web.config file has debug=true.
Then I call a web service that throws an exception. The stack trace does not contain the line numbers. I have no idea what I am missing here, any ideas?
Additional Info:
If I run the web app using VS built-in web server, it works and I get line numbers in stack trace. But if I copy the same files (pdb and dll) that the VS built-in web server is using to IIS, still the line numbers are missing in stack trace.
It seems that there is something related to the IIS that ignores the pdb files!
Update
When I publish to IIS, all the pdb files are published under the bin directory and everything looks fine. But when I go to "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files" under the specific directory related to my project, I can see that the assembly (.dll) files are all there, but there is no pdb files.
But this does not happen if I run the project using VS built-in web server.
So if I copy the pdb files manually to the temp folder, I can see the line numbers.
Any idea why the pdb files are not copied to the temp folder?
BTW, when I attach to the worker process I can see that it says Symbols loaded!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我遇到了同样的问题,并尝试了一切方法来尝试解决它。直到我在这个类似的问题中找到可接受的答案:即使存在 pdb,IIS 也没有在堆栈跟踪中给出行号。
我需要为我的大多数网站打开模拟(这些网站有行号,请看图),所以我为这个特定的网站禁用它并得到我的行号!
I had this is same issue and tried everything under the sun to try and fix it. Nothing worked until I found the accepted answer in this similar question: IIS not giving line numbers in stack trace even though pdb present.
I need impersonate to be turned on for most of my sites (and those sites have line numbers, go figure) so I disabled it for this particular website and got my line numbers!!
也许您要发布到的服务器在系统
machine.config
文件中配置了
设置:有关详细信息,请参阅:
只是一个想法。
Maybe the server you're publishing to has the
<deployment retail="true" />
setting configured in the systemmachine.config
file in:For more info see:
Just a thought.
使用 VS 或 Windbg 连接到工作进程,看看它是否能够找到您的 pdb 以及它是否与您的程序集匹配?
另一个常见原因是您实际上使用的是发布 dll [已优化]。我怀疑这与 IIS 有何特定关系。
Attach to worker process using VS or windbg and see whether it is able to find your pdb and whether it matches your assembly?
Another common reason is you are actually using release dlls [which are optimised]. I doubt it is anything specific to do with IIS.
请确保在 web.config 中设置“debug=true”,如果没有它,异常中不会显示行号。
Please make sure to set "debug=true" in the web.config, without it, no line numbers are shown in exceptions.
不确定这是否有帮助,但在我的 VS2008 C# 项目属性中,在“构建”选项卡下,有一个“高级”按钮,我必须在其中将调试信息设置为“完整”或“仅 pdb”
Not sure if this will help, but in my VS2008 C# project properties, under the build tab, there's an Advanced button where I had to set debug info to "full" or "pdb-only"