将调试符号嵌入Nuget不起作用

发布于 2025-01-26 22:26:08 字数 487 浏览 2 评论 0原文

我正在制作一个nuget软件包,并希望使用它的开发人员在调试期间能够逐步完成。

我听说过“符号软件包”,但是从我知道的小小中,对于我和用户来说,这似乎都很复杂,因为我需要设置一个符号软件包,并且用户需要配置符号服务器以使用。

我希望我只能将调试符号嵌入

  <DebugSymbols>true</DebugSymbols>
  <DebugType>embedded</DebugType>

项目文件中的包装中,但是当我与这些符号一起发布了与这些符号一起发布的测试包并从nuget.org上下载的一台计算机上下载它时,它就不起作用了。我在软件包源中设置的断点是跳过的,在调试期间说当前不会击中断点。在mypackage.dll(嵌入式)中找到了class1.cs的副本,但是当前的源代码与我不知道为什么会出现的mypackage.dll(嵌入式)内置的版本不同。

我该如何解决?

I am making a Nuget package and would like the devs that use it to be able to step through it during debug.

I've heard of "symbol packages" but from the little I know it seems complicated, both for me and for the user, as I would need to setup a symbol package and the user would need to configure a symbol server to use.

I was hoping I can just embed the debug symbols into the package using

  <DebugSymbols>true</DebugSymbols>
  <DebugType>embedded</DebugType>

in the project file, but when I published a test package with those and downloaded it from Nuget.org on another computer it does not work. The breakpoint I set in the package source is skipped and during debug it says The breakpoint will not currently be hit. A copy of Class1.cs was found in MyPackage.dll (embedded), but the current source code is different from the version built into MyPackage.dll (embedded) which I have no idea why comes up.

How can I fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拒绝两难 2025-02-02 22:26:08

经常发生,我在发布后不久就偶然发现了答案,我希望有人可以将&lt; debugsymbols&gt;捆绑在一起,因为我认为它们不会单独工作。

我缺少的是&lt; embedallsources&gt; true&lt;/embedallsources&gt;。这将源代码嵌入到软件包中,我认为两个选项“嵌入库”和“ debugsymbols”都没有使用。

似乎&lt; debugSymbols&gt;/debugsymbols&gt;不需要,因为true似乎是默认值。

任何有更多信息的人,请随时添加,正确和等。

编辑:

“ Release”配置忽略“ DebugSymbols”指令。因此,我不知道如何在“发行”中嵌入调试符号。

As often happens, I stumbled upon the answer shortly after posting, which I wish someone would bundle up with <DebugSymbols>, as I don't think they work separately.

What I was missing was <EmbedAllSources>true</EmbedAllSources>. This embeds the source code in the package and I don't think either of the two options "EmbedAllSources" and "DebugSymbols" works without the other.

It also seems <DebugSymbols>true</DebugSymbols> is unneeded, as true seems to be the default.

Anyone with more information, please feel free to add, correct and etc.

EDIT:

"Release" configuration ignores the "DebugSymbols" directive. So I don't know how you can embed debug symbols in "Release".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文