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

Cannot use embeded PackageReadmeFile when using snupkg for symbols #10791

Closed
meziantou opened this issue Apr 22, 2021 · 16 comments · Fixed by NuGet/NuGet.Client#4268
Closed

Cannot use embeded PackageReadmeFile when using snupkg for symbols #10791

meziantou opened this issue Apr 22, 2021 · 16 comments · Fixed by NuGet/NuGet.Client#4268
Assignees
Labels
Area:Symbols Functionality:Pack Priority:1 High priority issues that must be resolved in the current sprint. Type:Bug

Comments

@meziantou
Copy link

Details about Problem

NuGet product used: dotnet.exe

Product version: 6.0.0-preview.3.21201.4

Worked before? If so, with which NuGet version: 🤷‍♀️

Repro steps and/or sample project

  • dotnet new classlib
  • Create a non-empty readme.md file
  • Edit the csproj
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <RootNamespace>New_folder</RootNamespace>        
    <IncludeSymbols>true</IncludeSymbols>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
  </PropertyGroup>
  
  <PropertyGroup>
    <PackageReadmeFile>readme.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
    <None Include="readme.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
  • dotnet pack
Microsoft (R) Build Engine version 16.10.0-preview-21181-07+073022eb4 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
  NewFolder -> C:\Users\mezia\Desktop\NewFolder\bin\Debug\net6.0\NewFolder.dll
  Successfully created package 'C:\Users\mezia\Desktop\NewFolder\bin\Debug\NewFolder.1.0.0.nupkg'.
C:\Program Files\dotnet\sdk\6.0.100-preview.3.21202.5\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5039: The readme file 'readme.md' does not exist in the package. [C:\Users\mezia\Desktop\NewFolder\NewFolder.csproj]

Additional information

  • It can generate the package if you remove <SymbolPackageFormat>
  • There is no issue with the <PackageIcon> nor <PackageLicenseFile> properties, so it seams to be only for the PackageReadmeFile
@BlackGad
Copy link
Contributor

BlackGad commented Apr 22, 2021

snupkg package format strongly limited with content filter by extensions (*.pdb and some more)

@zkat zkat added Area:ContentFiles PackageReference contentFiles folder Functionality:Pack Area:Symbols and removed Area:ContentFiles PackageReference contentFiles folder labels Apr 27, 2021
@zkat zkat self-assigned this Apr 29, 2021
@zkat
Copy link
Contributor

zkat commented Apr 29, 2021

We need to look into what we do here for licenses.

@MarkStega
Copy link

Confirming the same issue with a Net5 project and "Microsoft (R) Build Engine version 16.10.0-preview-21175-01+afd0b6210 for .NET" as the build engine.

@campersau
Copy link

Maybe this is check !PackageTypes.Contains(PackageType.SymbolsPackage) which is already in ValidateLicenseFile
and ValidateIconFile needs to be added to ValidateReadmeFile too.

Also in PackageMetadataXmlExtensions the readme element is always added whereas the elements for licenseUrl and icon are not because of the same check here !PackageTypes.Contains(PackageType.SymbolsPackage).

@loic-sharma
Copy link
Contributor

loic-sharma commented Aug 1, 2021

This blocks many popular projects from adopting embedded READMEs, including:

  • Newtonsoft.Json
  • Serilog
  • AutoMapper
  • NUnit
  • NLog
  • Polly
  • RestSharp
  • CsvHelper
  • SixLabors.ImageSharp
  • And lots more :(

The silver lining is that snupkg adoption is great with our most popular packages! 😅

@zkat
Copy link
Contributor

zkat commented Oct 4, 2021

@v-zubritsky can you file a separate bug for this so we can track and triage it separately?

@uladz-zubrycki
Copy link

uladz-zubrycki commented Oct 4, 2021

@zkat Sure thing.

#10791

cravecode added a commit to cravecode/CraveInjectables.SqlDataService that referenced this issue Oct 9, 2021
Must wait until NuGet/Home#10791 is resolved before adding symbols
@loic-sharma
Copy link
Contributor

Hello everyone, .NET 6 RC2 has been released with this fix. You can download it here: https://dotnet.microsoft.com/download/dotnet/6.0

@brminnick
Copy link

Thanks @loic-sharma! I can confirm that, using .NET 6 RC, it now works for my NuGet Packages (when it hadn't been working before .NET 6 RC2)!

I just published both with their NuGet Readme + snupkg 🎉

swharden added a commit to ScottPlot/ScottPlot that referenced this issue Oct 12, 2021
Previously a NuGet bug prevented this format in packages with a readme.md NuGet/Home#10791
thargy added a commit to DevDecoder/HIDDevices that referenced this issue Oct 14, 2021
Due to [this issue](NuGet/Home#10791) it turns
out there was a bug in NuGet when using the new `PackageReadmeFile`
alongside symbol packages, that is only fixed in .NET 6.0 RC2, which has
only just been released!

Bumping the actions to required pre-release 6.0 versions in anticipation
of GitHub adding them to the CI.
@thargy
Copy link

thargy commented Oct 14, 2021

Fixed for me too. 👍🏻

@RehanSaeed
Copy link

I still seem to be having issues:

Successfully created package '/home/runner/work/Serilog.Enrichers.Span/Serilog.Enrichers.Span/Artefacts/Serilog.Enrichers.Span.1.4.1-preview.0.7.nupkg'.
Error: /home/runner/.dotnet/sdk/6.0.100-rc.1.21463.6/Sdks/NuGet.Build.Tasks.Pack/buildCrossTargeting/NuGet.Build.Tasks.Pack.targets(221,5): error NU5039: The readme file 'README.md' does not exist in the package. [/home/runner/work/Serilog.Enrichers.Span/Serilog.Enrichers.Span/Source/Serilog.Enrichers.Span/Serilog.Enrichers.Span.csproj]
An error occurred when executing task 'Pack'.
Error: One or more errors occurred. (.NET Core CLI: Process returned an error (exit code 1).)
	.NET Core CLI: Process returned an error (exit code 1).
Error: Process completed with exit code 1.

My directory structure:

Source
  Serilog.Enrichers.Span
    Serilog.Enrichers.Span.csproj
README.md

Any ideas where I'm going wrong?

@Apostolique
Copy link

@RehanSaeed It won't work unless you upgrade to .NET 6 RC2. That's the version with the fix. You're still on .NET 6 RC1.

Jericho added a commit to Jericho/StrongGrid that referenced this issue Oct 15, 2021
swharden added a commit to ladeak/FftSharp that referenced this issue Oct 25, 2021
previously prevented by NuGet bug NuGet/Home#10791
swharden added a commit to ladeak/FftSharp that referenced this issue Oct 25, 2021
try to get around current NuGet bug NuGet/Home#10791
AArnott added a commit to AArnott/Library.Template that referenced this issue Oct 26, 2021
This reverts commit 295a532.

This is due to NuGet/Home#10791. We can reapply the readme after switching to .NET SDK 6.0.
swharden added a commit to swharden/Spectrogram that referenced this issue Oct 27, 2021
now that NuGet bug has been resolved NuGet/Home#10791
ndsvw added a commit to ndsvw/Fluent-Random-Picker that referenced this issue Nov 21, 2021
raphac pushed a commit to raphac/3DContainerPacking that referenced this issue Jan 6, 2022
raphac pushed a commit to raphac/3DContainerPacking that referenced this issue Jan 6, 2022
theKBro added a commit to Buerkert/Buerkert.VncLib that referenced this issue Mar 3, 2022
theKBro added a commit to Buerkert/Buerkert.VncLib that referenced this issue Feb 10, 2023
ericdotnet added a commit to ericdotnet/Eric-csharp that referenced this issue May 13, 2024
previously prevented by NuGet bug NuGet/Home#10791
ericdotnet added a commit to ericdotnet/Eric-csharp that referenced this issue May 13, 2024
try to get around current NuGet bug NuGet/Home#10791
ericdotnet added a commit to ericdotnet/Streams-Nerdbank-pro that referenced this issue May 13, 2024
This reverts commit 295a5328208e65883c9a3add6fdfdba3bd14b34a.

This is due to NuGet/Home#10791. We can reapply the readme after switching to .NET SDK 6.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area:Symbols Functionality:Pack Priority:1 High priority issues that must be resolved in the current sprint. Type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.