Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
chitsaw opened this issue Dec 5, 2018 · 3 comments
Closed

Comments

@chitsaw
Copy link

chitsaw commented Dec 5, 2018

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

@nkolev92
Copy link
Member

nkolev92 commented Jan 11, 2019

Merged in release-4.9.3-rtm

@StevenTCramer
Copy link

I download the sample above and it still fails.

λ  dotnet --version
3.0.100-preview-010184
C:\git\temp\MySampleLibrary
λ  dotnet build
Microsoft (R) Build Engine version 16.0.385-preview+g966cdf2ac6 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restoring packages for C:\git\temp\MySampleLibrary\MySampleLibrary.csproj...
  Generating MSBuild file C:\git\temp\MySampleLibrary\obj\MySampleLibrary.csproj.nuget.g.props.
  Restore completed in 149.27 ms for C:\git\temp\MySampleLibrary\MySampleLibrary.csproj.
C:\Program Files\dotnet\sdk\3.0.100-preview-010184\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.targets(151,5): message NETSDK1057: You are using a preview version of .NET Core. See: https://aka.ms/dotnet-core-preview [C:\git\temp\MySampleLibrary\MySampleLibrary.csproj]
  MySampleLibrary -> C:\git\temp\MySampleLibrary\bin\Debug\netstandard2.0\MySampleLibrary.dll
  Successfully created package 'C:\git\temp\MySampleLibrary\bin\Debug\MySampleLibrary.1.0.0.nupkg'.
C:\Program Files\dotnet\sdk\3.0.100-preview-010184\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(199,5): error NU5030: The license file 'LICENSE.txt' does not exist in the package. [C:\git\temp\MySampleLibrary\MySampleLibrary.csproj]

Build FAILED.

C:\Program Files\dotnet\sdk\3.0.100-preview-010184\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(199,5): error NU5030: The license file 'LICENSE.txt' does not exist in the package. [C:\git\temp\MySampleLibrary\MySampleLibrary.csproj]
    0 Warning(s)
    1 Error(s)

@eerhardt
Copy link

I assume this bug was fixed in the .NET Core SDK 2.2.105? I am seeing this issue with 2.2.103, but not 2.2.105.

eerhardt added a commit to eerhardt/arrow that referenced this issue Mar 15, 2019
Work around NuGet/Home#7591 until CI gets the updated SDK version.
jaaufauvre added a commit to Mastercard/client-encryption-csharp that referenced this issue Jun 25, 2019
jaaufauvre added a commit to Mastercard/client-encryption-csharp that referenced this issue Jun 25, 2019
jaaufauvre added a commit to Mastercard/oauth1-signer-csharp that referenced this issue Jun 25, 2019
jaaufauvre added a commit to Mastercard/client-encryption-csharp that referenced this issue Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants