問題描述
我正在使用 MSBuild 生成我的 nuget 包.
I am using MSBuild to generate my nuget packages.
我是否需要設置任何命令,以允許它包含我的 .pdb
文件,以便在調試時進入源代碼?
Is there any command I need to set, to allow it to include my .pdb
files, for stepping into the source while debugging?
我不希望將源文件包含在拉入 nuget 包的項目中.
I do not want the source files to be included into the project that is pulling in the nuget package.
推薦答案
雖然它可能對調試沒有幫助,但包含 .pdb 文件絕對有用,以便堆棧跟蹤具有行號.
While it may not help for debugging, it's definitely useful to include .pdb files so that stack traces have line numbers.
在 nuspec 文件中,包含一個
元素(
的子元素,
的兄弟元素).這是我的一個類庫中的內容:
In the nuspec file, include a <files>
element (child of <package>
, sibling of <metadata>
). This is what I have in one of my class libraries:
<files>
<file src="bin$configuration$$id$.pdb" target="lib
et452" />
</files>
確保目標與您的 .dll 文件放在包中的文件夾相同.
Make sure the target is the same folder as where your .dll file is put in the package.
這篇關于將 pdb 文件包含到我的 nuget (nupkg) 文件中的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!