Nuget cakebuild:如何在DotNetCorePack中指定许可证?

Nuget cakebuild:如何在DotNetCorePack中指定许可证?,nuget,cakebuild,Nuget,Cakebuild,我尝试在cake脚本中指定nuget包的许可证 以下内容不起作用-它没有将任何许可证放入nuget软件包中,我也找不到任何文档说明如何正确指定它: var msbuildsettings = new DotNetCoreMSBuildSettings(); msbuildsettings = msbuildsettings.WithProperty("PackageLicenseExpression", "'LGPL-2.0-or-later'"); var settings

我尝试在cake脚本中指定nuget包的许可证

以下内容不起作用-它没有将任何许可证放入nuget软件包中,我也找不到任何文档说明如何正确指定它:

   var msbuildsettings = new DotNetCoreMSBuildSettings();
   msbuildsettings = msbuildsettings.WithProperty("PackageLicenseExpression", "'LGPL-2.0-or-later'");

   var settings = new DotNetCorePackSettings
    {
        MSBuildSettings = msbuildsettings,
        Configuration = "Release",
        OutputDirectory = "BuildOutput/NugetPackages",
        NoBuild = true,

    };

    foreach(var gassembly in list)
        DotNetCorePack(gassembly.Csproj, settings);


我不确定这是否是蛋糕问题。Cake只是包装了现有的工具

NuGet文档告诉您如何指定包元数据。使用
dotnetpack


我不确定这是否是蛋糕问题。Cake只是包装了现有的工具

NuGet文档告诉您如何指定包元数据。使用
dotnetpack


PackageLicenseExpression属性的值应该是没有任何撇号的有效字符串

只需删除撇号,代码就可以正常工作,并将许可证表达式添加到NuGet包中

msbuildsettings = msbuildsettings.WithProperty("PackageLicenseExpression", "LGPL-2.0-or-later");

PackageLicenseExpression
属性的值应该是没有任何撇号的有效字符串

只需删除撇号,代码就可以正常工作,并将许可证表达式添加到NuGet包中

msbuildsettings = msbuildsettings.WithProperty("PackageLicenseExpression", "LGPL-2.0-or-later");