Joshua Frank
Joshua Frank

Reputation: 13838

asp.net error shows byte offsets instead of line numbers, EVEN in debug mode

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:

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.

Upvotes: 4

Views: 1080

Answers (1)

Joshua Frank
Joshua Frank

Reputation: 13838

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!

Upvotes: 5

Related Questions