Projects which set IncludeBuildOutput=false are likely to hit NU5128 · Issue #8583 · NuGet/Home (original) (raw)
Details about Problem
Many projects set IncludeBuildOutput=false, then manually define the layout of their package. In case they are defining content other than lib/ref (eg: build/*, tools, or SDK) they are likely to hit NU5218, since the project's dependencies will make it into the package: IncludeBuildOutput does not control the inclusion of dependencies.
NuGet product used (NuGet.exe | VS UI | Package Manager Console | dotnet.exe):
dotnet.exe
NuGet version (x.x.x.xxx):
5.3.0.6192
dotnet.exe --version (if appropriate):
3.0.0-rc1-19455-02
VS version (if appropriate):
N/A
OS version (i.e. win10 v1607 (14393.321)):
N/A
Worked before? If so, with which NuGet version:
Yes, dotnet 2.x, past previews of 3.0
Detailed repro steps so we can see the same problem
- Run
dotnet pack
against the following project:
Expect: no build errors
Actual: build errors due to warnings as errors for NU5128.
Workaround is to set <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
as may be the intent for a project setting <IncludeBuildOutput>false</IncludeBuildOutput>
. I don't think this is always the intent, so I don't think this property should be derived from IncludeBuildOutput
.
Other suggested things
Issue is originally discussed here: dotnet/arcade#3861 (comment)
Related: #8576
Verbose Logs
https://github.com/NuGet/Home/files/3602557/msbuild.binlog.zip
Sample Project
See above