NU5039 The readme file ‘README.md’ does not exist in the package
Jan 8, 2024
This appears to be quite a common issue and it happened to me unexpectedly when trying to pack a legacy library. The library concerned was written in net core 3.1 and has recently been upgraded to .net 8.0
The first thing I tried was adding
<IsPackable>true</IsPackable>
to the csproj file but this made no difference. I also checked the CopyToOutputDirectory setting.
Finally I noticed that I had
<PackageReadmeFile>README.md</PackageReadmeFile>
and ALSO had
<ItemGroup>
<None Update="README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
Removing the PackageReadmeFile entry resolved the issue for me