Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 237
kaptan Avatar asked Feb 04 '10 23:02

kaptan


1 Answers

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

like image 164
Chris Porter Avatar answered Sep 23 '22 07:09

Chris Porter