Okay this works with https://www.nuget.org/api/v2/ as the target, not the older v1 at packages.nuget.org. Found out v2 with fiddler
IWizard with multiproject template to grab nuget prerelease package
-
05-12-2021 - |
Question
I have created a multi-project template and when creating a new project I'm having success installing nuget packages into all my projects when it comes to regular release versions, but I'm trying to grab signalr's prerelease version and it can't find the version '1.0.0-alpha2'. I assume because its a prelease. Although I can grab it from within VS's PM prompt using :
Install-Package Microsoft.AspNet.SignalR.JS -version 1.0.0-alpha2
...Is there something different with the API that I need to do to grab it or what am I doing wrong?
Example within my project templates wizard
var componentModel = (IComponentModel)services.GetService(typeof(SComponentModel));
IVsPackageInstaller installerServices = componentModel.GetService<IVsPackageInstaller();
installerServices.InstallPackage("http://packages.nuget.org", project, "Microsoft.AspNet.SignalR.JS", "1.0.0-alpha2", false);
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow