使用 Visual Studio 2022 17.1 将 *.pdb 文件嵌入托管库中
Visual Studio 2022 的 17.1 更新最近发布,新增功能之一是:
在构建托管库时,开发人员可以选择将构建生成的调试信息(PDB 文件)嵌入其源文件,甚至将 PDB 文件嵌入到程序集本身中。如果引用的程序集具有嵌入式源并且 PDB 可用,我们现在会将嵌入式源作为“转到定义”的一部分进行显示。这允许您导航到声明目标符号的原始源文件。将光标放在符号上,然后按 F12 导航到原始源文件。
但是我找不到任何关于如何做到这一点的信息。
有人知道吗?
此外,如果我想将包发布到 NuGet 并使任何将该包添加到其解决方案中的人都可以调试我的包的代码,我是否只需要嵌入 PDB 还是还需要其他东西?
The 17.1 update for Visual Studio 2022 recently hit and one of the added functionalities is:
When building managed libraries developers can choose to embed their source files with the debug information (PDB file) that is produced by the build, and even embed the PDB file into the assembly itself. We now surface embedded source as part of Go to Definition if a referenced assembly has embedded source and the PDB is available. This allows you to navigate to the original source files that declare the target symbol. Place your cursor on a symbol and press F12 to navigate to the original source file.
However I can't find anything on how to do that.
Does anyone know?
In addition, if I want to publish a package to NuGet and make it so anyone who adds that package to their solution can debug my package's code, do I only need to embed the PDBs or is something more required?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明这是项目属性中的一个选项:
Turns out it's an option found in project properties: