Package content is not restored correctly when installing a package from a nuget v3.3+ feed with the argument -NoCache when the package contains *.nupkg files (original) (raw)
I have a Nuget package which itself contains other Nuget packages (*.nupkg files). When I install this package, the contained *.nupkg files are missing from the output location.
The issue only occurs when installing packages from nuget v3.3+ feeds. If I install the package from a local file share or a nuget v2 feed it works as expected and the output location has the contained *.nupkg files in it.
When I install a package from a nuget v3.3+ feed it is first copied and extracted to a machine cache which normally is under %appprofile%, but can be changed with the environment variable NUGET_PACKAGES. In this temporary location the package content is correct (it contains the *.nupkg files). It is when the package content is copied from the temporary location to the output directory that contained *.nupkg files end up missing.
Furthermore, the broken behavior is influenced by the use of the –NoCache switch to nuget.exe. If I don’t specify –NoCache, then the package content correctly contains all the .nupkg files.
To repro create a Nuget package that contains *.nupkg files, upload it to a nuget v3.3+ feed and restore it from there using the -NoCache argument to nuget.exe.