How to download a nupkg package from nuget programmatically in .NET Core?

后端 未结 2 1293
广开言路
广开言路 2021-02-13 03:31

In past with .NET Framework I used this example for working with nuget programmatically

Play with Packages, programmatically!

Is there any equivalent source for

2条回答
  •  野的像风
    2021-02-13 03:47

    The code sample you have shown uses NuGet 2 which is not supported on .NET Core. You'll need to use NuGet 3 or the (soon to be released) NuGet 4. These APIs are a huge break from NuGet 2. One of these breaking changes is that NuGet.Core is obsolete on won't be ported to .NET Core.

    Checkout NuGet API v3 on docs.microsoft.com for info on NuGet 3. At the time of writing, this doc is basically a big TODO and doesn't have much info.

    Here are some blog posts that are more useful.

    Exploring the NuGet v3 Libraries, Part 1 Introduction and concepts

    Exploring the NuGet v3 Libraries, Part 2

    Exploring the NuGet v3 Libraries, Part 3

    And of course, you can always go spelunking through NuGet's source code to find more examples. Most of the core logic lives in https://github.com/nuget/nuget.client.

提交回复
热议问题