2

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);
N. Taylor Mullen
  • 18,061
  • 6
  • 49
  • 72
james
  • 408
  • 7
  • 22

1 Answers1

2

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

james
  • 408
  • 7
  • 22
  • I was trying the same, but i got an error stating "An exception of type 'System.InvalidOperationException' occurred in NuGet.VisualStudio.dll but was not handled in user code Additional information: The project 'Core' is unsupported". Do you have any idea why i am getting this error ? – Moble Joseph Jan 21 '15 at 10:07
  • What version is your Nuget.VisualStudio.dll ? Did you follow this? http://docs.nuget.org/docs/reference/invoking-nuget-services-from-inside-visual-studio If you're using the new version, you don't reference Nuget.Core.dll anymore – james Jan 21 '15 at 16:00
  • yes, i removed the nuget.core and it worked. Thanks :) – Moble Joseph Jul 21 '15 at 08:59