Produce warning when a IsPackableProject=true references IsPackable=false project
#9.797 geöffnet am 14. Juli 2020
Repository-Metriken
- Stars
- (1.459 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 464T 23h) (1 gemergte PR in 30 T)
Beschreibung
Details about Problem
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe): dotnet.exe dotnet.exe --version (if appropriate): 3.1.200
Worked before? If so, with which NuGet version: No
Detailed repro steps so we can see the same problem
- Create two projects, Packable and NonPackable
Packable.csproj
<IsPackable>true</IsPackable>
<ProjectReference Include="NonPackable.csproj" />
NonPackable.csproj false
This configuration will produce a "Packable.nupkg" that can't ever work, because "NonPackable" doesn't (and won't ever) exist, because it's not packable. But the build doesn't produce any sort of warning, and everything works fine locally because of the PackagReference. The only time you notice it fails is when it gets pushed to a feed, like nuget.org, and then tries to resolve the NonPackable package. That's really late in the process to get notified of such a dangerous issue.
It would be great if the build could product a warning when this happens. It happens a lot in a repository I manage, because we have a service, as well as some utility DLL's for accessing that server, in the same repository. The service DLL's are not packable, but the helper DLL's go to a feed. But it's easy in VS to accidentally add a reference to a "shared" DLL that contains some utilities or something, that was previously only referenced by the service, so wasn't packable, and then publish bad packages to the feed, and I had to scramble to fix that.