NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 252 forks source link

Improve NU5039 message and documentation #13226

Open marcpopMSFT opened 7 months ago

marcpopMSFT commented 7 months ago

NuGet Product Used

dotnet.exe

Product Version

All

Worked before?

No response

Impact

It bothers me. A fix would be nice

Repro Steps & Context

I was trying to create a dynamic readme file in a package. What I didn't realize was that PackageReadmeFile specifies the location within the nupkg that the readme file will live, NOT the location in my build. So previously my readme was getting packages from the root of my project and I moved it to being packages from the IntermediateOutputFolder. When doing so, I updated the PackageReadmeFile to specify the new location not realizing what that value actually meant.

Neither the error nor documentation for that error make it clear that in my situation, PackageReadmeFile should not have included the different path as the file was till packaged into the root of the nupkg.

The below will cause the error and I was eventually able to fix it but the error and documentation could be improved.

    <PackageReadmeFile>$(IntermediateOutputPath)README.md</PackageReadmeFile>
     <None Include="$(PackageReadmeFile)" Pack="true" PackagePath="\"/>

Verbose Logs

No response

baronfel commented 7 months ago

I'd go so far as to propose an enhancement - look for a metadata on a None/Content MSBuild item like IsPackageReadmeFile and automatically generate the proper value of the PackageReadmeFile property from that. That's both more clear to a novice MSBuild reader and something that can be made correct by construction.

ghost commented 7 months ago

Issue is missing Type label, remember to add a Type label

nkolev92 commented 7 months ago

https://github.com/NuGet/Home/issues/10839 was created at some point regarding making the inclusion simpler.