Skip to content

Error building symbol .snupkg package when using embedded license file #7591

@chitsaw

Description

@chitsaw

Details about Problem

Attempting to build symbol NuGet .snupkg package fails when using embedded license file with the PackageLicenseFile property.

NuGet product used: VS UI, dotnet pack

dotnet.exe --version: 2.1.500

VS version: 15.9.3

OS version: win10 v1809 (17763.134)

Detailed repro steps so we can see the same problem

  1. Build a C# netstandard2.0 project in Visual Studio 15.9.3 with the following properties set in the .csproj file:
  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
    <PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
    <IncludeSymbols>true</IncludeSymbols>
  </PropertyGroup>

  <ItemGroup>
    <None Include="LICENSE.txt" Pack="true" PackagePath="$(PackageLicenseFile)"/>
  </ItemGroup>
  1. Build generates the main .nupkg file successfully but fails to generate the .snupkg with the following error message:
    error NU5030: The license file 'LICENSE.txt' does not exist in the package.

  2. Expected build to generate both .nupkg and .snupkg files.

Verbose Logs

Please include verbose logs (NuGet.exe -verbosity detailed | dotnet.exe --verbosity diag | etc...)

log.txt

Sample Project

Very helpful if you can zip a project and paste into this issue!

MySampleLibrary.zip

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions