在发布模式下显示 .NET 程序集的堆栈跟踪中的行数 [英] Display lines number in Stack Trace for .NET assembly in Release mode

查看:20
本文介绍了在发布模式下显示 .NET 程序集的堆栈跟踪中的行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法显示在发布模式下构建/部署的 .NET 程序集的堆栈跟踪中的行?

Is there a way to display the lines in the stack trace for the .NET assembly build/deployed in Release mode?

更新:

我的应用程序分为三个类库项目和一个ASP.NET网站"项目.我试图追踪的错误是在三个类库项目之一中.我只为生成对象引用未设置为对象的实例"错误的类库项目部署了 pdb 文件.

My application is divided into three class library projects and one ASP.NET "website" project. The error I am trying to track down is in one of the three class library projects. I only deployed the pdb file for the class library project that is generating the "Object reference not set to an instance of an object" error.

行号仍未显示在堆栈跟踪中.我是否需要为所有项目部署 pdb 文件以获取堆栈跟踪中的行号?

The line numbers are still not showing up in the stack trace. Do I need to deploy the pdb files for all projects to get the line numbers in the stack trace?

工作解决方案

为每个应用程序部署 pdb 文件修复了行号问题.

Deploying the pdb file for each application fixed the line number issue.

推荐答案

  • 进入要查看堆栈跟踪行号的项目的属性"窗口.
  • 单击构建"垂直选项卡".
  • 选择发布"配置.检查 DEBUG 常量参数.
  • 取消选中优化代码";参数以避免偶尔出现内联代码的跟踪问题(此步骤不是必需的).
  • 按高级...按钮并选择输出 ->调试信息 ->仅限 pdb.
  • 使用程序集部署生成的 .pdb 文件.
    • 要检查的另一件事是在Package/Publish Web"中排除生成的调试符号"部分复选框也未选中

    这篇关于在发布模式下显示 .NET 程序集的堆栈跟踪中的行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆