New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install/restore of a particular package fails with "Package contains multiple nuspec files." #3231

Closed
jmyersmsft opened this Issue Jul 27, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@jmyersmsft

jmyersmsft commented Jul 27, 2016

Steps to repro:

  1. Use 3.5.0-rc build 1657. 3.5.0-beta2 does not have the bug.
  2. nuget locals -Clear All
  3. nuget install Microsoft.TeamFoundationServer.Client -Version 14.83.0 (specifically this version of this package)

This also occurs at least when restoring a packages.config with this specific package version. I manually downloaded the package and it only appears to have one nuspec. Strangely, running the same install command again without clearing the caches does not repro the bug.

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Jul 28, 2016

Contributor

@jmyersmsft - Can you please try a "dev branch", not "release-3.5.0-rc" build? http://nuget.org/downloads will have it at the bottom of page. let us know what build you try. thx.

Contributor

rrelyea commented Jul 28, 2016

@jmyersmsft - Can you please try a "dev branch", not "release-3.5.0-rc" build? http://nuget.org/downloads will have it at the bottom of page. let us know what build you try. thx.

@jmyersmsft

This comment has been minimized.

Show comment
Hide comment
@jmyersmsft

jmyersmsft Jul 29, 2016

@rrelyea same behavior with 3.5.0-rc1-1667 which is the build currently available from the nightly builds link

jmyersmsft commented Jul 29, 2016

@rrelyea same behavior with 3.5.0-rc1-1667 which is the build currently available from the nightly builds link

@jmyersmsft

This comment has been minimized.

Show comment
Hide comment
@jmyersmsft

jmyersmsft Jul 29, 2016

I believe I've found the issue.

Microsoft.TeamFoundationServer.Client 14.83.0 does only contain one nuspec. However, it is named Microsoft.TeamFoundation.Client.nuspec (note the lack of the word Server). When the package is unpacked, Microsoft.TeamFoundation.Client.nuspec ends up on disk in the global packages folder, but so does a copy of it named microsoft.teamfoundationserver.client.nuspec, so there are then two .nuspec files in the folder.

I verified that this was the critical element by modifying the package so that the name of the nuspec matched the package name, pushing the modified package to a private package source, clearing my locals, and installing again from the private source. The package installed without complaint.

jmyersmsft commented Jul 29, 2016

I believe I've found the issue.

Microsoft.TeamFoundationServer.Client 14.83.0 does only contain one nuspec. However, it is named Microsoft.TeamFoundation.Client.nuspec (note the lack of the word Server). When the package is unpacked, Microsoft.TeamFoundation.Client.nuspec ends up on disk in the global packages folder, but so does a copy of it named microsoft.teamfoundationserver.client.nuspec, so there are then two .nuspec files in the folder.

I verified that this was the critical element by modifying the package so that the name of the nuspec matched the package name, pushing the modified package to a private package source, clearing my locals, and installing again from the private source. The package installed without complaint.

@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Jul 29, 2016

Collaborator

@jmyersmsft I think you are right, it looks like NuGet should remove the old nuspec file after modifying it for the v3 folder format.

Collaborator

emgarten commented Jul 29, 2016

@jmyersmsft I think you are right, it looks like NuGet should remove the old nuspec file after modifying it for the v3 folder format.

@rrelyea rrelyea added this to the 3.5 RTM milestone Jul 29, 2016

emgarten added a commit to NuGet/NuGet.Client that referenced this issue Jul 29, 2016

Avoid duplicate nuspec files during v3 extraction
The V3 folder format requires nuspec files to be named with the package id. This change fixes an issue where the nuspec is copied but the original nuspec is also extracted. This causes problems later when using the package folder reader to read the nuspec.

This fix also adds GetNuspecFile to the package reader instead of an extension method. The previous check did not filter out non-root nuspec files and could have found extra duplicates that should have been ignored. It also improves performance for the package folder reader which has an optimized path for finding the nuspec on disk.

Fixes NuGet/Home#3231
@emgarten

This comment has been minimized.

Show comment
Hide comment
@emgarten

emgarten Jul 29, 2016

Collaborator

This will be fixed in build 1679 and up

Collaborator

emgarten commented Jul 29, 2016

This will be fixed in build 1679 and up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment