Nuget package RavenDB.Embedded: Unable to find a version of 'RavenDB.Database' that is compatible with 'System.Spatial 5.0.2' - nuget

In a new project when I try to add the NugetPackage : RavenDB.Embedded
I have the following error :Updating 'System.Spatial 5.2.0' to 'System.Spatial 5.0.2' failed. Unable to find a version of 'RavenDB.Database' that is compatible with 'System.Spatial 5.0.2'.

i think this is a nuget bug. try using:
Install-Package RavenDB.Embedded -DependencyVersion Highest

Related

NU1102: Unable to find package Microsoft.Windows.SDK.BuildTools with version (>= 10.0.19041.8)

In my build pipeline, I have the following step:
I am getting the following error:
##[error]The nuget command failed with exit code(1) and error(NU1102: Unable to find package Microsoft.Windows.SDK.BuildTools with version (>= 10.0.19041.8)
When I go to the NuGet page for this package: Microsoft.Windows.SDK.BuildTools, I see that it only has one version: 10.0.18362.3-preview. I am not sure why the NuGet restore step is trying to get a higher version that does not exist. Why is this happening and how can I fix it? Note: this is my first Pipeline.
Agent Specification: Windows-2019.
From this page, you can see only two versions of the package Microsoft.Windows.SDK.BuildTools are listed:
10.0.19041.1
10.0.18362.3-preview
When open the page of version 10.0.19041.1, you can see the warning message to notify that this package version has been deprecated. But it seems that you can still download and install it.
I think the other package versions may have been permanently deleted by the owner due to some security vulnerabilities. So you no longer find them.
You can try to open your project using Visual Studio on your local machine, and change to use version 10.0.18362.3-preview in your program.

'AutoMapper' already has a dependency defined for 'Microsoft.CSharp'

When I am trying to install 'AutoMapper' it gives me an error "'AutoMapper' already has a dependency defined for 'Microsoft.CSharp'" in VS2010.I am trying to install Automapper latest version AutoMapper.6.1.0. I have already tried the following things but it's not worked for me.
1) Updated Nuget Package manager with latest version 2.8.60318.667
2) I have also manually deleted refernece from Automapper nuspec XML file
Please any one suggest me what can be issue for this.
After installing an older version of the Automapper its work for me. try to use Install-Package Automapper -Version 4.0.4 command from package manager console.

Unable to Use Nuget with MvvmCross - PCL

Following the tutorial for mvvmcross here: http://www.youtube.com/watch?v=_DHDMNB_IeY&list=PLR6WI6W1JdeYSXLbm58jwAKYT7RQR31-W&index=1
I've set up my PCL xml files to include MonoTouch and Mono for Android as instructed here: http://slodge.blogspot.co.uk/2013/04/my-current-pcl-setup-in-visual-studio.html
If I try to use nuget I get an error that an item with the same key has already been added:
I can add other project types to the solution and NuGet works fine, it's something specific to PCL projects. Here is the console output:
PM> Install-Package MvvmCross.HotTuna.StarterPack
Attempting to resolve dependency 'MvvmCross.HotTuna.CrossCore (≥ 3.0.8.1)'.
Attempting to resolve dependency 'MvvmCross.PortableSupport (≥ 3.0.8.1)'.
Installing 'MvvmCross.PortableSupport 3.0.8.1'.
Successfully installed 'MvvmCross.PortableSupport 3.0.8.1'.
Installing 'MvvmCross.HotTuna.CrossCore 3.0.8.1'.
Successfully installed 'MvvmCross.HotTuna.CrossCore 3.0.8.1'.
Installing 'MvvmCross.HotTuna.StarterPack 3.0.8.1'.
Successfully installed 'MvvmCross.HotTuna.StarterPack 3.0.8.1'.
Adding 'MvvmCross.PortableSupport 3.0.8.1' to BLUBCNMOBL.Core.
Uninstalling 'MvvmCross.PortableSupport 3.0.8.1'.
Successfully uninstalled 'MvvmCross.PortableSupport 3.0.8.1'.
Install failed. Rolling back...
Install-Package : An item with the same key has already been added.
At line:1 char:1
Microsoft Visual Studio Premium 2012 (Version 11.0.60315.01 Update 2)
Nuget v 2.5
My guess is that one of the XML files you added git snafu'd during copy and paste.
Try deleting whatever you added and try adding them again.
Alternatively, it could be that someone else has added conflicting files? Eg xamarin have recently added pcl support so maybe they've added files?
To try collecting more info, you could try using the nuget command line - does that give you any more diagnostic info.

How can I install an older version of a package via NuGet?

I want to install an older version of a package (Newtonsoft.Json). But NuGet rolls back:
PM> Install-Package Newtonsoft.Json -Version 4.0.5
Successfully installed 'Newtonsoft.Json 4.0.5'.
Install failed. Rolling back...
Install-Package : Already referencing a newer version of 'Newtonsoft.Json'.
How can I do it?
Try the following:
Uninstall-Package Newtonsoft.Json -Force
Followed by:
Install-Package Newtonsoft.Json -Version <press tab key for autocomplete>
As of NuGet 2.8, there is a feature to downgrade a package.
NuGet 2.8 Release Notes
Example:
The following command entered into the Package Manager Console will downgrade the Couchbase client to version 1.3.1.0.
Update-Package CouchbaseNetClient -Version 1.3.1.0
Result:
Updating 'CouchbaseNetClient' from version '1.3.3' to '1.3.1.0' in project [project name].
Removing 'CouchbaseNetClient 1.3.3' from [project name].
Successfully removed 'CouchbaseNetClient 1.3.3' from [project name].
Something to note as per crimbo below:
This approach doesn't work for downgrading from one prerelease version to other prerelease version - it only works for downgrading to a release version
I've used Xavier's answer quite a bit. I want to add that restricting the package version to a specified range is easy and useful in the latest versions of NuGet.
For example, if you never want Newtonsoft.Json to be updated past version 3.x.x in your project, change the corresponding package element in your packages.config file to look like this:
<package id="Newtonsoft.Json" version="3.5.8" allowedVersions="[3.0, 4.0)" targetFramework="net40" />
Notice the allowedVersions attribute. This will limit the version of that package to versions between 3.0 (inclusive) and 4.0 (exclusive). Then, when you do an Update-Package on the whole solution, you don't need to worry about that particular package being updated past version 3.x.x.
The documentation for this functionality is here.
Now, it's very much simplified in Visual Studio 2015 and later. You can do downgrade / upgrade within the User interface itself, without executing commands in the Package Manager Console.
Right click on your project and *go to Manage NuGet Packages.
Look at the below image.
Select your Package and Choose the Version, which you wanted to install.
Very very simple, isn't it? :)
Another more manual option to get it:
.nuget\nuget.exe install Newtonsoft.Json -Version 4.0.5

Error installing Entity Framework package

I got a strange error when trying to install the latest version of EntityFramework(4.1.10715.0) from the package manager:
The 'schemaVersion' attribute is not declared.
How can I solve this?
Try to install the latest NuGet version