Display lines number in Stack Trace for .NET assembly in Release mode(在发布模式下显示 .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 文件.
- 要检查的另一件事是在打包/发布 Web"中.排除生成的调试符号"部分复选框也未选中
这篇关于在发布模式下显示 .NET 程序集的堆栈跟踪中的行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在发布模式下显示 .NET 程序集的堆栈跟踪中的行号
基础教程推荐
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- 如果条件可以为空 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- 将数据集转换为列表 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 从 C# 控制相机设备 2022-01-01
