开发者

Missing line number in stack trace eventhough the PDB files are included

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 开发者_StackOverflowthe 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!


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.

It turns out using impersonation with the web.config:

<identity impersonate="true" />

causes the loss of the line numbers in the stacktrace. I took the entry out and my line numbers returned, put it back and after a few hours (Kerberos ticket refreshing?) the line numbers disappeared again.

Not sure why impersonation affects the stack trace but it does - would be happy to have someone confirm / explain this...

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!!


Maybe the server you're publishing to has the <deployment retail="true" /> setting configured in the system machine.config file in:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG

For more info see:

ASP.NET configuration - deployment Element (ASP.NET Settings Schema)

Just a thought.


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.


Please make sure to set "debug=true" in the web.config, without it, no line numbers are shown in exceptions.


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"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜