示例如下:
Stack Trace:
IndexOutOfRangeException: Index was outside the bounds of the array.MyNameSpace.SPAPP.ViewDetailsCodeBehind.LoadView() +5112
MyNameSpace.SPAPP.ViewDetailsCodeBehind.Page_Load(Object sender,EventArgs e) +67
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,Object o,Object t,EventArgs e) +13
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,EventArgs e) +43
System.Web.UI.Control.OnLoad(EventArgs e) +98
… …
问题是显示的行号与我的代码中引发异常的行不对应.
在上面的例子中,堆栈显示行号5111,但我的.cs文件后面的代码只有250行!
aspx页面存储在SharePoint站点中,带有代码的程序集已部署到GAC.另外,我已经在Debug模式下编译了.
鉴于上面的设置,我如何找出代码中的哪一行导致异常?
strelokstrelok指出的澄清:
In Release mode the number in front of the exception is NOT the line of code. Instead it’s an offset to the native compiled code,which doesn’t have any meaning to humans. More about this here: 07001
In debug mode the PDB file will automatically map the native code offset to your .cs line in code and the number displayed WILL be the corresponding line in code.
解决方法
原文地址:https://www.jb51.cc/csharp/100912.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。