I did a quick search and although it looks like I’m not the only one with this problem, since there isn’t an easy solution out there:
- How to download a Nuget package without nuget.exe or Visual Studio extension? from nuget.org
- Downloading a local NuGet repository with PowerShell
- NuGet Package Explorer
- Install NuGet package programatically
- Nuget.Downloader 22.214.171.124
I had already tried to do this in the past, and before I run out of time, I did managed to create a couple scripts:
The NuGet_Installer.cs is a typical (O2 based) installer script that will download Nuget …
… and put it on the _ToolsOrApis folder:
The API_Nuget.cs is basically an process/console-out wrapper of the nuget.exe process
with a bunch of Extension Methods to help with the command line invocation of NuGet.exe
But this is not what I want. I need to execute and consume the NuGet classes directly.
Which means to access the Commands available in NuGet programatically and recreate the NuGet API’s extension methods.
And that is what I describe in Retrieving NuGet package programatically using NuGet.exe classes (not command line)
Note that the API_NuGet.cs is not completed at this stage (that will be shown in a future post)
See also Offline copy of the entire NuGet.org gallery. What should I do with these 4.05 Gbs of amazing .Net Apps/APIs?