-
Notifications
You must be signed in to change notification settings - Fork 268
Closed
Labels
Resolution:DuplicateThis issue appears to be a Duplicate of another issueThis issue appears to be a Duplicate of another issue
Description
NuGet Product Used
dotnet.exe
Product Version
5.0.301
Worked before?
No response
Impact
I'm unable to use this version
Repro Steps & Context
It looks like NuGet fails to pack a .snupkg if the project has an embedded README. Notice the .nupkg file is generated but not the .snupkg in the logs below.
HelloWorld.csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>README.md:
Hello world
Class1.cs:
namespace HelloWorld
{
public class Class1 { }
}Verbose Logs
> dotnet build ; dotnet pack
Microsoft (R) Build Engine version 16.10.1+2fd48ab73 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored D:\Code\Scratch\4\HelloWorld.csproj (in 62 ms).
HelloWorld -> D:\Code\Scratch\4\bin\Debug\net5.0\HelloWorld.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.12
Microsoft (R) Build Engine version 16.10.1+2fd48ab73 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
HelloWorld -> D:\Code\Scratch\4\bin\Debug\net5.0\HelloWorld.dll
Successfully created package 'D:\Code\Scratch\4\bin\Debug\HelloWorld.1.0.0.nupkg'.
C:\Program Files\dotnet\sdk\5.0.301\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. [D:\Code\Scratch\4\HelloWorld.csproj]Exception in binlog:
NuGet.Packaging.Core.PackagingException: The readme file 'README.md' does not exist in the package.
at NuGet.Packaging.PackageBuilder.ValidateReadmeFile(IEnumerable`1 files, String readmePath)
at NuGet.Packaging.PackageBuilder.Save(Stream stream)
at NuGet.Commands.PackCommandRunner.BuildPackage(PackageBuilder builder, String outputPath, Boolean symbolsPackage)
at NuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path)
at NuGet.Commands.PackCommandRunner.BuildPackage(String path)
at NuGet.Commands.PackCommandRunner.RunPackageBuild()
at NuGet.Build.Tasks.Pack.PackTaskLogic.BuildPackage(PackCommandRunner runner)
at NuGet.Build.Tasks.Pack.PackTask.Execute()
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Resolution:DuplicateThis issue appears to be a Duplicate of another issueThis issue appears to be a Duplicate of another issue