Skip to content
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

Lots of bugs encountered while upgrading nuget from v2 to v4 #7472

Open
Barsonax opened this issue Nov 3, 2018 · 2 comments
Open

Lots of bugs encountered while upgrading nuget from v2 to v4 #7472

Barsonax opened this issue Nov 3, 2018 · 2 comments
Labels
Functionality:SDK The NuGet client packages published to nuget.org Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Triage:NeedsMoreInfo

Comments

@Barsonax
Copy link

Barsonax commented Nov 3, 2018

We are running into problems with the new way packages are structured. Nuget v2 is not able to handle this. This is why we want to update our nuget from v2 to v4. However we are running into some serious problems with the nuget libraries:

  • I noticed that FolderNuGetProject simply returns a empty IEnumerable when you call GetInstalledPackagesAsync. This looks like a pretty serious bug to me.
  • When updating a package it does not remove the old package. Might have to do with the above?
  • There is also a PackagesConfigNuGetProject but that one does not install any packages? It just updates a packages.config file.
  • Uninstalling only works with a solution manager?? Makes no sense really. Just uninstall that package...
  • Consider provinding a synchronous API as well. Not all projects can use async await which means we have to wrap everything up in another class.
  • To top this off there seems to be no documentation on using the libraries.

Iam getting the feeling the v4 library is not designed or meant to be consumed by 3th parties. It seems that its only meant to be used in VS and msbuild. Am I correct in this?

If the above is true what is the best way to add support for the new package structure which nuget v2 cannot handle? Do we have to build our own client using the REST api?

@rrelyea
Copy link
Contributor

rrelyea commented Nov 5, 2018

Can you give us more information about your scenarios?
What are you doing with NuGet API?
Would command line calls work just as well?

We likely need more details on each of those problems...
FolderNuGetProject returns empty...for which kind of project, etc... How can we repro this?
Updating a package using what technique?
(perhaps these should all be separate issues?)

@Barsonax
Copy link
Author

Barsonax commented Nov 9, 2018

What are you doing with NuGet API?

We currently have a game engine called (duality)[https://duality.adamslair.net/] that uses the nuget v2 API to manage plugins. Basically we are looking for the following functionality:

  • List all packages that contain certain tags, this is how we find plugins for duality.
  • Install a package
  • Update a package
  • Uninstall a package
  • Restore packages from a package config file

FolderNuGetProject returns empty...for which kind of project, etc... How can we repro this?

After noticing this strange behavior I decompiled FolderNugetProject.GetInstalledPackagesAsync and this is the result:

    /// <summary>Asynchronously gets installed packages.</summary>
    /// <param name="token">A cancellation token.</param>
    /// <returns>A task that represents the asynchronous operation.
    /// The task result (<see cref="P:System.Threading.Tasks.Task`1.Result" />) returns an
    /// <see cref="T:System.Collections.Generic.IEnumerable`1" />.</returns>
    public override Task<IEnumerable<PackageReference>> GetInstalledPackagesAsync(CancellationToken token)
    {
      return Task.FromResult<IEnumerable<PackageReference>>(Enumerable.Empty<PackageReference>());
    }

Also the source here reflects this as well.

So there is no way it could ever return the installed packages. Idk why its implemented like this because there is no documentation but this really looks like a bug.

@zivkan zivkan added the Functionality:SDK The NuGet client packages published to nuget.org label Mar 23, 2021
@jeffkl jeffkl added Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. and removed Pipeline:Icebox labels Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:SDK The NuGet client packages published to nuget.org Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Triage:NeedsMoreInfo
Projects
None yet
Development

No branches or pull requests

7 participants