8

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!

SamB
  • 9,039
  • 5
  • 49
  • 56
kaptan
  • 3,060
  • 5
  • 34
  • 46
  • are you using WCF to call that webservice? – Rubens Farias Feb 04 '10 at 23:54
  • possible duplicate of [IIS not giving line numbers in stack trace even though pdb present](http://stackoverflow.com/questions/2673623/iis-not-giving-line-numbers-in-stack-trace-even-though-pdb-present) – Kapé Apr 07 '14 at 16:03

5 Answers5

3

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

Community
  • 1
  • 1
Chris Porter
  • 3,627
  • 25
  • 28
  • 1
    This is the only solution that worked for me. I hope that "impersonate=true" is not something needed by my sites. – Arvin Mar 27 '12 at 04:47
  • 1
    Thanks this is one of those little hidden Microsoft side effects that can make you waste really lots of time – f.cipriani Aug 08 '18 at 15:53
0

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.

Kev
  • 118,037
  • 53
  • 300
  • 385
  • i checked that file and there is no in that file. – kaptan Feb 15 '10 at 17:50
  • In a comment in the above linked post http://stackoverflow.com/questions/2673623/iis-not-giving-line-numbers-in-stack-trace-even-though-pdb-present/2673642#2673642, user @Graeme says that if you do this, it turns off stack tracing entirely, not just line numbers. – Joshua Frank Oct 21 '11 at 13:05
0

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.

Fakrudeen
  • 5,778
  • 7
  • 44
  • 70
0

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

titrat
  • 9
  • 1
0

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"

harvest316
  • 1,401
  • 14
  • 21