How to get line number from Stack Trace?

  • Thread starter Thread starter Robert Barish
  • Start date Start date
R

Robert Barish

Here is a sample Stack Trace that I may get from a typical error in my ASP.NET Web application. Notice the number +521 at the end of the second line. How do I interpret this into a real line number within my code?

[SocketException (0x2afc): The requested name is valid, but no data of the requested type was found]
StoreFront.payment.PleaseWaitButton1_Click(Object sender, EventArgs e) +521
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
 
If the pdb is the same one that was built with the app, they should be the same.
Here is a sample Stack Trace that I may get from a typical error in my ASP.NET Web application. Notice the number +521 at the end of the second line. How do I interpret this into a real line number within my code?

[SocketException (0x2afc): The requested name is valid, but no data of the requested type was found]
StoreFront.payment.PleaseWaitButton1_Click(Object sender, EventArgs e) +521
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
 
There is no PDB, this is a release version of my DLL.
If the pdb is the same one that was built with the app, they should be the same.
Here is a sample Stack Trace that I may get from a typical error in my ASP.NET Web application. Notice the number +521 at the end of the second line. How do I interpret this into a real line number within my code?

[SocketException (0x2afc): The requested name is valid, but no data of the requested type was found]
StoreFront.payment.PleaseWaitButton1_Click(Object sender, EventArgs e) +521
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
 
You can't get the line number if the DLL is not compiled in debug mode.
There is no PDB, this is a release version of my DLL.
If the pdb is the same one that was built with the app, they should be the same.
Here is a sample Stack Trace that I may get from a typical error in my ASP.NET Web application. Notice the number +521 at the end of the second line. How do I interpret this into a real line number within my code?

[SocketException (0x2afc): The requested name is valid, but no data of the requested type was found]
StoreFront.payment.PleaseWaitButton1_Click(Object sender, EventArgs e) +521
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292
 
Back
Top