2

I'm uploading a private nuget package to a private nuget repository. The package is commercial (not open source).

The csproj has this:

<PackageLicenseExpression>Commercial</PackageLicenseExpression>

I receive a build warning that the above is not a valid "license expression".

What value do I use?

lonix
  • 14,255
  • 23
  • 85
  • 176

1 Answers1

2

You need to embed your license file, you can't use the license expression: https://learn.microsoft.com/nuget/reference/msbuild-targets#packing-a-license-expression-or-a-license-file

<PropertyGroup>
    <PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>

<ItemGroup>
    <None Include="licenses\LICENSE.txt" Pack="true" PackagePath=""/>
</ItemGroup>

NuGet's license expressions use SPDX identifiers, and I don't see any "generic" commercial license.

zivkan
  • 12,793
  • 2
  • 34
  • 51