Closed ltrzesniewski closed 3 years ago
@clairernovotny how could I help with this issue?
Go for it. What happens when NuGet restores the package? Only one of the files could be on the disk.
I just checked, and dotnet restore
does not detect this issue (as of the SDK v5.0.201). One of the two files is written to the disk.
@jondouglas should NuGet pack error out on this condition? seems like it would always lead to an ambiguous result.
Pretty sure we just added an error for this last month. Let me look.
@JonDouglas Thank you! Is it deployed yet. I dont get an error when I run dotnet.exe pack
with a scenario that causes this.
@clairernovotny I will say, I do think the basic premise of a NugetPackageExplorer should be that it handle bad zip files with duplicate contents, since the whole point is to see how the zip file is laid out in Nuget-land.
Note, it also looks like this problem can occur as a result of https://github.com/NuGet/Home/issues/3584
@JonDouglas I looked at the warning in https://github.com/NuGet/NuGet.Client/pull/3923 and its not exactly optimal, since it tells you sort of what we already know - that there is a duplicate inside the package. Would be nicer if dotnet.exe pack
warns you as its about to add the duplicate what the provenance of both the duplicate and original file was.
I'll guess I'll try MSBuild Bin Log viewer tool from Kirill Osenkov.
Actually, I don't understand how this duplicate detection logic works.
It also looks like there is no way to disable this logic.
I think the problem is that the order in which duplicates is removed from PackageFiles is incorrect, and so there are scenarios in which it is impossible to remove a PackageFiles value from the Pack Task. This is something I (believe I) noticed a few weeks ago when trying Nugetizer for the first time.
I figured it out - the duplicate detection occurs even when the nuspec file itself contains overlapping entries. I was assuming the duplicate came from MSBuild csproj being packed, rather than the nuspec file.
Closing as by design then.
When a faulty package contains a duplicated file, NPE doesn't show it (FodyCommon.dll in this example):
Type: Bug
NPE version: 5.5.23
OS version: Windows 10 - 1903
Installed from: GitHub release
What is the current result? The duplicated file is shown only once
What is the expected result? The duplicated file should be displayed twice, as in the zip
Are there any workarounds? No
Is there a version in which it did work? Probably not
Is there a package on Nuget.org which shows the bug?
https://www.nuget.org/api/v2/package/Fody/6.0.4
Reported here: https://github.com/Fody/Fody/issues/763