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 for native code, 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 already checked:

  • The application binary file is compiled in debug mode.
  • I have "Generate Debugging Information" set to "Full"
  • The application pdb file is deployed in the bin directory and has the same creation timestamp as the dll file.
  • Setting compilation = "true" in web.config does not matter.
  • Removing "Enable Optimization" does not matter.

This particular server belongs to the IT department, and I do not have access to it, nor any knowledge about machine-level overrides. However, I expected ASP.NET to use pdb files, but it does not.

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

+4
source share
1 answer

Well, after much research, I found the answer here on SO: IIS, not providing line numbers in the stack trace, although pdb is present .

For convenience, I will describe the answer here. if you have

 <identity impersonate="true" /> 

in your web.config file, this disables the line numbers in the stack trace (unless you grant the rights to seize users). I took this and now I get the line numbers.

I’ll just show you that the words you use to formulate the problem can really affect whether the existing answer to the question for you on the same thing matches you !

+5
source

All Articles