【问题标题】:NuGet exclude files from symbols package in nuspecNuGet 从 nuspec 中的符号包中排除文件
【发布时间】:2014-03-10 19:25:03
【问题描述】:

在对具有随附 .nuspec 文件的 .csproj 文件执行 nuget 包时,从符号 .nupkg 中排除某些文件的语法是什么?

为了清楚起见,我不想将这些文件从正常的 .nupkg 中排除,而只是从符号 .nupkg 中排除。这是因为 SymbolSource fails to parse these files 作为托管程序集。

我们的workaround 是在创建后从符号 .nupkg 中删除特定文件,但最好在 the .nuspec file 或 package 命令中以某种声明方式排除它们。

【问题讨论】:

    标签: nuget symbols nuspec


    【解决方案1】:

    这可能有点 hack,但你可以这样:

    nuget pack mypackage.nuspec -Symbols -Exclude "*/*.exe;*/*.dll"
    

    "*/*.exe;*/*.dll" 是你想忽略然后运行的文件

    nuget pack mypackage.nuspec
    

    您的 mypackage.nuspec 包含您在常规 nuget 包中所需的所有内容。

    这应该不会导致任何问题,因为 dll、pdb 和 nuget 包应该仍然具有所有匹配的版本。

    【讨论】:

    • Hack 与否,这是迄今为止最好的(唯一)解决方案。谢谢!
    猜你喜欢
    • 2013-01-05
    • 1970-01-01
    • 1970-01-01
    • 2021-11-18
    • 1970-01-01
    • 1970-01-01
    • 2015-08-17
    • 1970-01-01
    • 2022-01-03
    相关资源
    最近更新 更多