4

In my deployed .NET 3.5/ASP.NET web application, error stack traces always show byte offsets to native code and not line numbers:

...
System.Linq.Enumerable.ToList(IEnumerable`1 source) +61
MyApp.prLoadData() +3931                             <--should show line number
MyApp.Page_Load(Object sender, EventArgs e) +1378    <--should show line number
System.Web.UI.Control.OnLoad(EventArgs e) +99
...

Things I've already thoroughly checked:

  • The application binary is compiled in debug mode.
  • I have "Generate Debug Info" set to "Full"
  • The application pdb file is deployed to the bin directory and has the same creation timestamp as the dll file.
  • Setting compilation="true" in web.config makes no difference.
  • Unchecking "Enable Optimizations" makes no difference.

This particular server is owned by the IT department and I have no access to it, nor any knowledge of machine level overrides. Still, I would have expected ASP.NET to use the pdb files, but it isn't doing it.

Does anyone know what's going on here? Thanks in advance.

Joshua Frank
  • 13,120
  • 11
  • 46
  • 95
  • Are you sure your IT department actually deployed the pdb files? I think you need to have a sit down with them. – NotMe Oct 20 '11 at 17:53
  • Yes, I can see the files there. When I said I had no access, I meant to IIS and the server file system. I can see my own app directory, and the pdb file is in place. – Joshua Frank Oct 20 '11 at 17:57

1 Answers1

5

Well, after a lot of research, I found the answer here on SO: IIS not giving line numbers in stack trace even though pdb present.

For convenience, I'll summarize the answer here. If you have

<identity impersonate="true" />

in your web.config file, this disables line numbers in stack tracing (unless you grant the impersonated user Debug rights). I took that out and now I get line numbers.

Just goes to show you that the words you use to phrase the problem can really make a difference in whether you match an existing answered question on the exact same thing!

Community
  • 1
  • 1
Joshua Frank
  • 13,120
  • 11
  • 46
  • 95