nuget get different versions swicth - nservicebus

I am trying to nuget the new 3.0 binaries for NServiceBus but they don't seem to be available in package manager.
Is there a switch to force nuget to get the latest available version?

The 3.0 line is in pre-release at the moment, so you'll have to do:
PM> Install-Package NServiceBus -Pre
At the time of this answer, it will install RC5.
The switch -Pre is short for -PreRelease, which will install a pre-release version if it's more recent than the latest stable. If a stable version is more recent, it will install the stable. See this NServiceBus page on nuget. For details on prerelease on nuget, see the versioning page.
You can also try the continuous integration (CI) package:
PM> Install-Package NServiceBus-CI

Related

How can I configure nuget to not suggest Updates when Dependencies aren't met?

I have a number of projects inside a solution that are .netcoreapp11 based.
In Visual Studio Ver 15.5.6, with Nuget Package Manager Ver 4.5.0,
I have a page full of updates that show Dependencies on .NETStandard, Version=v2.0.
Trying to update any of them results in
Package Microsoft.AspNetCore.Server.Kestrel... 2.0.1 is not compatible with netcoreapp1.1
I am not in a position to move our Solution to .Net Core 2 at this time.
How do I configure my solution or nuget to not suggest updates I am unable to apply?
How do I configure my solution or nuget to not suggest updates I am unable to apply?
I am afraid there is no such direct configuration for your solution or nuget to not suggest updates for all packages automatically.
That is because nuget only detect if there is a higher version in all nuget sources based on the version in the PackageReference rather than detect that the version to be upgraded is compatible with the Target framework. Only when we install nuget package to the project, nuget will detect whether this package is compatible with the Target framework. This is default design for nuget. So we could not direct configuration for the solution or nuget to not suggest updates before we install that packages.
To resolve this issue, there is a workaround that we could manually constrain nuget package upgrade versions for each package by specifying version range Version="[1.*, 2.0.0)":
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="[1.*, 2.0.0)" />
</ItemGroup>
In this case, when nuget will not suggest update that package to version 2.0:
Note: You should use a * is the correct way to float to a higher version.
Hope this helps.

Error when installing NUnit 3.9 in Visual Studio 13 with NuGet

I am trying to install NUnit 3.9 in Visual Studio 13 Professional, but I am facing the below mentioned error while installing:
'NUnit' already has a dependency defined for 'NETStandard.Library'.
How do I solve this issue?
This error is often caused by the fact that your version of NuGet is too old. Try updating NuGet.
NUnit's most recent NuGet packages include .NET Standard builds, which mean NuGet client version 2.12 or later is required. From the next version of NUnit, you'll get a more helpful error message for this.
If you cannot upgrade Visual Studio to a newer version that includes newer versions of NuGet, you can install NUnit 3.5.0 which doesn't include .NET Standard. You can select the older versions from a dropdown in the user interface, or install from the Package Manager Console.
Install-Package NUnit -Version 3.5.0

Wrong EntityFramework version is being installed

From the Package Manager Console I do this:
Install-Package EntityFramework -Version 5.0.0
And then I right-click on the Reference and I see it is version 4.4.0.0. Doing an uninstall and then installing doesn't help.
This happens for 1 project in the solution, in another project it installs the correct version.
Turns out that the problem was the Project was .NET 4.0, once I upgraded it to 4.5 it installs the correct version.

NuGet Issue installing SignalR and Raven

I am trying to use NuGet to add SignalR and Raven to a new ASP.Net MVC 4 project.
If I do SignalR first, then try to add Raven I get the following error:
Install failed. Rolling back... Install-Package : Already referencing
a newer version of 'Newtonsoft.Json'.
If I install Raven first, then SignalR I get:
Install failed. Rolling back... Install-Package : Updating
'Newtonsoft.Json 4.5.7' to 'Newtonsoft.Json 4.5.8' failed. Unable to
find a version of 'RavenDB.Client' that is compatible with
'Newtonsoft.Json 4.5.8'.
I thought NuGet was meant to handle this sort of thing?
How can I get them both added?
It appears that RavenDB.Client has an exact-version constraint on Newtonsoft.Json = 4.5.7, while SignalR has a more relaxed constraint of '4.5.4 or higher' (actually a constraint imposed by one of its own dependencies, SignalR.Server).
I managed to get your above scenario working with some manual tweaking:
Created new MVC4 project
Opened up packages.config and added an 'allowedVersions="[4.5.7]"' attribute to the Newtonsoft.Json package entry
Opened the package manager console (View... Other windows... Package Manager Console) and ran update-packages to pull in latest code for all default dependencies (takes a while)
Again in package manager console, ran install-package RavenDB.Client
Finally in package manager console, ran install-package SignalR
I tried a few combinations of ordering the above but it wasn't liking it - the thing that let it work seems to be the manual editing of packages.config to lock the version of Newtonsoft.Json to 4.5.7 so that subsequent installs don't trash the referenced version.
We ran into this exact issue, but ultimately pulled in the Raven assemblies manually (so we could target a specific version).
Something that we came across is that it is possible to force Nuget to install a package using the command line tools:
How to install an older version of package via NuGet?
I ran into the same issue, but instead decided to install an older version of SignalR. Version 4.0 (February 2012) has a dependency on NewtonSoft >= 4.0.7, and this installs correctly with RavenDB already installed:
Install-Package SignalR -Version 0.4.0
I got the same problem with Raven and the standard MVC template. I wanted the latest version of Newtonsoft.Json so I solved it differently.
I checked what dependencies RavenDB Client had and then installed the latest version of them first Newtonsoft.Json and NLog
I then installed the packet in the Packet manager Console with the -IgnoreDependencies flag.
Install-Package -Id RavenDB.Client -IgnoreDependencies
That worked fine. (I am taking a calculated risk that RavenDB is not compatible with the latest Newtonsoft.Json at the moment. But I am a Daredevil)

Installing specific version of package

I'm new to nuget and this is probably a very simple question but I could not find an answer to it.
I want to install the newest package of Fluent NHibernate (here) but whenever I install this package it installs the "recommended version" here (the one with the little blue and white thumbs up beside it)
Is there a way to specify which version you want to install from the visual studio plugin?
You can use powershell to get a specific version
Install-Package Elmah -Version 1.0
See the reference - http://docs.nuget.org/