【问题标题】:ASP.Net stacktrace no line number. PDB files availableASP.Net stacktrace 没有行号。可用的 PDB 文件
【发布时间】:2016-12-01 12:36:29
【问题描述】:

我有一个 asp.net 页面。有时我在以下堆栈跟踪中遇到错误。

   at COMPANY.EasyInvoicing.Web.BusinessLogic.PromoterProjectLocationActivityDataSourceGet(ActivityType activityType, InvoiceController invoiceController, Nullable`1 invoiceId, Boolean ignoreAlreadyInUse, Boolean receiptMandatory) in C:\Projekte\COMPANY\Promoter\EasyInvoicing\Web\BusinessLogic\1.0\BusinessLogic.cs:line 0
   at COMPANY.EasyInvoicing.Web.UI.Invoicing.ShowInvoicePositionProfessionalFeePopUp() in C:\Projekte\COMPANY\Promoter\EasyInvoicing\Web\UI\1.0\Invoicing.aspx.cs:line 142
   at COMPANY.EasyInvoicing.Web.UI.Controls.Invoicing.Invoice.professionalFeeButton_Click(Object sender, EventArgs e) in C:\Projekte\COMPANY\Promoter\EasyInvoicing\Web\UI\1.0\controls\Invoicing\Invoice.ascx.cs:line 308
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

如您所见,错误发生在“PromoterProjectLocationActivityDataSourceGet”中,但我无法解决,因为行号为 0。

页面以发布模式构建并部署pdb文件。

此外,web.config 包含以下条目:

<compilation debug="false">

我的第一个想法是将 debug="false" 设置为 true,但在某些方法中行号可用,而在其他方法中不可用。所以这不是所有方法的普遍问题。

你能帮帮我吗?

【问题讨论】:

  • 第一个问题,它在开发环境中工作吗?
  • 我无法在开发环境中重现错误。所以我不知道它是否会工作
  • 错误信息是什么?
  • 对象引用未设置为对象的实例。
  • 我已经将方法中的一些对象设置为零来测试它。结果:是的,它适用于开发环境。显示行号

标签: c# asp.net .net debugging


【解决方案1】:

请尝试以下方法:

项目属性 -> 构建 -> 高级 -> 调试信息 > 设置为“完整”

【讨论】:

  • 我会试试的。谢谢
  • @OPunktSchmidt 有用吗?如果是,请标记为答案。
  • 这不是解决方案:/
  • 尝试将其设置为 'pdb-only',然后部署生成的 .pdb 文件。另一个尝试的选择是,如果您在 web.config 中有此行​​,请将其删除:&lt;identity impersonate="true" /&gt;
  • PDB 文件已部署。 不在我的 web.config 中
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-07-24
  • 2016-01-26
  • 1970-01-01
相关资源
最近更新 更多