Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget installs wrong package version

SignalR version 1.0.0 is out, but I want to install the old version 1.0.0-rc1.

I used this command but NuGet seems to ignore the version flag and install 1.0.0 anyway.

PM> Install-Package Microsoft.AspNet.SignalR -Version 1.0.0-rc1 -Pre
Attempting to resolve dependency 'Microsoft.AspNet.SignalR.JS (≥ 1.0.0-rc1)'.
Attempting to resolve dependency 'jQuery (≥ 1.6.4)'.
Attempting to resolve dependency 'Microsoft.AspNet.SignalR.SystemWeb (≥ 1.0.0-rc1)'.
Attempting to resolve dependency 'Microsoft.AspNet.SignalR.Owin (≥ 1.0.0)'.
Attempting to resolve dependency 'Microsoft.AspNet.SignalR.Core (≥ 1.0.0)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 4.5.11)'.
Attempting to resolve dependency 'Owin (≥ 1.0)'.
Attempting to resolve dependency 'Microsoft.Owin.Host.SystemWeb (≥ 1.0.0)'.
Attempting to resolve dependency 'Microsoft.Web.Infrastructure (≥ 1.0.0.0)'.
'Microsoft.AspNet.SignalR 1.0.0-rc1' already installed.
Successfully added 'Microsoft.AspNet.SignalR 1.0.0-rc1' to GeoMVC.

The last line claims that 1.0.0-rc1 was successfully installed, but clearly NuGet is resolving dependencies for 1.0.0 rather than 1.0.0-rc1. When I look at the references in my project, they are version 1.0.0.

I've tried uninstalling the package using uninstall-package Microsoft.AspNet.SignalR -force and then reinstalling it. Same as above.

What am I doing wrong?

like image 742
jcarpenter2 Avatar asked Dec 09 '25 00:12

jcarpenter2


1 Answers

The reason why this is happening is because the Dependencies on the SignalR 1.0.0-rc2 all are >= 1.0.0-rc2 so when it auto resolves the packages it resolves them to be the rtw version.

There's no magic or easy way to fix this but a work around is to install the packages from the base up. For example install the Core components first and then work your way up the chain.

Install-Package Microsoft.AspNet.SignalR.JS -Version 1.0.0-rc2 -Pre  
Install-Package Microsoft.Owin.Host.SystemWeb -Version 1.0.0-rc2 -Pre  
Install-Package Microsoft.AspNet.SignalR.Core -Version 1.0.0-rc2 -Pre  
Install-Package Microsoft.AspNet.SignalR.Owin -Version 1.0.0-rc2 -Pre  
Install-Package Microsoft.AspNet.SignalR.SystemWeb -Version 1.0.0-rc2 -Pre  
Install-Package Microsoft.AspNet.SignalR-Version 1.0.0-rc2 -Pre  

I believe this is all correct. Let me know if I forgot something.

Hope this helps!

like image 134
N. Taylor Mullen Avatar answered Dec 12 '25 02:12

N. Taylor Mullen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!