Error installing Microsoft.Azure.CosmosDB.Table NuGet - c#

Trying to install Microsoft.Azure.CosmosDB.Table version 1.1.3, but keep getting the error
Unable to resolve dependency 'Microsoft.Azure.Storage.Common'.
Source(s) used: 'nuget.org', 'Microsoft Visual Studio Offline
Packages'
My current project is from the Azure QnA bot template
Any help with this would be much appriciated!

Error installing Microsoft.Azure.CosmosDB.Table NuGet
This is a known issue on GitHub, if project is configured to use packages.config this issue will manifest itself.
And this issue is fixed for PackageReference. NuGet team are determining if needs to fix this for packages.config, or leave it as is.
Before add nuget package, go to Tools-Options->NuGet Package Manager->General, change the default package management format to PackageReference. Then restart the Visual Studio, reload your project, add that package.
If you still get the same error, please check following Troubleshooting:
Use Package Manage Console to install the Microsoft.Azure.CosmosDB.Table package and its dependencies. To do
this, type the following in the Package Manager Console for your
solution.
Install-Package Microsoft.Azure.CosmosDB.Table -IncludePrerelease
Using your preferred Nuget package management tool, install the Microsoft.Azure.Storage.Common Nuget package before installing
Microsoft.Azure.CosmosDB.Table.
Hope this helps.

Related

How do I install Newtonsoft.json for Visual Studio 2010?

I am trying to make Newtonsoft.json available for use in my local Visual Studio 2010 projects. I installed NuGet.Tools on my system. Now I see an item in the Solution Explorer called Service References that wasn't there before, but I don't understand how to use that to reference the Newtonsoft package I also downloaded, which is currently in my Downloads folder. Do I need to move the package to a different location to reference it?
Thanks for your help.
You can right click on the project where you want to install newtonsoft nuget package.
You will find an option "Manage NuGet packages".
Then search online for "newtonsoft".
This would add a packages.config file in your project (depending on which framework you are targeting to ).
this new file contains all the nuget dependencies required for this project.
Refer this blog for more details
VS2010 is old and is unable to update to the latest NuGet version. This means that adding recent packages will often fail; however, you can often add an older version of a package that has a compatible NuGet version and it will work. This causes the suggested answer by #ManojChoudhari to fail for me. In the case of Newtonsoft.Json, the following worked using the Package Manager Console:
Install-Package Newtonsoft.Json -Version 9.0.1

XDocument NuGet Package won't install

In my application I'm trying to read XML files and was attempting to use the System.Xml.Linq utilities. I'm using the .net framework 4.6.1 and trying to install the System.Xml.XDocument NuGet package for that purpose.
When I try to install it from the Package Manager, it seems to install correctly (gains the checkmark in the browse tab of manager), but when I check the installed packages, it doesn't show up. I go back to browse on the package manager and it is back to not being installed in my project. I tried installing via the console, but got this error:
Error finding repository for 'https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/': An error occurred while retrieving package metadata for 'System.Xml.XDocument.4.3.0' from source 'Microsoft and .NET'.
A task was canceled.
So I downloaded the NuGet Package from NuGet.org and dumped it in a folder on my computer, tried installing it from there and it seemed to work, the console no longer producing errors, but I was still getting the same behavior in the Package Manager.
I've deleted my project.json.lock file and done a dotnet restore command a few times while trying to figure this out, but I've hit something of a brickwall in what I can do to get this package installed and usable.
In the meantime I've installed and am using the System.Xml.XmlDocument NuGet Package, so at the very least I know I can install other packages.
After working with the member of my team who knows far more about NuGet Packages than I, he pointed it out to me that System.Xml.XDocument isn't supported while using the .Net 4.6.1 Framework. The correct Package to use is/was System.Xml.XPath.XDocument.
Would have been nice to have some indication of that in Package Manager instead of the installed package just uninstalling itself, but That is going to be a marker for me to look for that in the future.

Package requires NuGet client version '2.12'

I am trying to install 'WindowsAzure.Storage 8.0.1' in visual studio 2012, but getting the error
package requires NuGet client version '2.12' or above, but the current NuGet version is '2.8.60318.667'.
on running command "Install-Package NuGet.Client"
Attempting to resolve dependency 'NuGet.Versioning (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Packaging (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Common (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Packaging.Core (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Packaging.Core.Types (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Frameworks (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.Repositories (≥ 3.5.0)'.
Attempting to resolve dependency 'NuGet.RuntimeModel (≥ 3.5.0)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 6.0.4)'.
Attempting to resolve dependency 'NuGet.ContentModel (≥ 3.5.0)'.
'NuGet.Client 3.5.0' already installed.
But still I am getting the error.
The 'WindowsAzure.Storage 8.0.1' package requires NuGet client version '2.12' or above, but the current NuGet version is '2.8.60318.667'.
Update your NuGet Package Manager extension. Go to Tools->Extensions and Updates and select Updates->Visual Studio Gallery. Update the NuGet Package Manager extension. Then try to install the package after Visual Studio gets restarted.
NuGet 2.12 only supports Visual Studio 2013 and later. If you're on Visual Studio 2012 you're out of luck.
I struggled with this issue in Visual Studio 2010 when I was trying to add NewtonSoft.Json nuget package into my project. When I try to run the latest version of the nuget package from nuget package manager console:
PM> Install-Package Newtonsoft.Json
It results in the same error as mentioned by OP:
package requires NuGet client version '2.12' or above, but the current
NuGet version is '2.8.60318.667'.
So I thought I would update the NuGet extension in Visual Studio first to latest version. But when I went into Tools -> Extensions and Updates window the Updates tab wasn't showing any update for Nuget extension. So it seems NuGet client version 2.12 isn't available/supported in Visual Studio 2010 at all. I was running out of options now.
So finally, I tried to install a specific lower version (6.0.3) of Newtonsoft.Json package deliberately this way:
PM> Install-Package Newtonsoft.Json {Your Project Name} 6.0.3
This worked successfully.
Latest version of this package at the time of writing this post is 10.0.3 instead.
So, it might be the case that newer version of a nuget package is compatible with only latest version of nuget package manager. So sometimes explicitly installing a lower version of the package might help you. Older version of a nuget package will of course be compatible with older nuget extension in Visual Studio if it is not up-to-date.
The only caveat in this solution is that the functionalities present in lower version of the nuget package you target should suffice your current project needs. Good luck!
Note: Although I've elaborated this solution w.r.t. Visual Studio 2010 but you can try this work around for any Visual Studio version for that matter.
I find out the solution for this problem.
Basically you have a .nuget folder at solution level, that folder contains a nuget.exe file that probably is old. A lot of packages might need new version of that file.
Open this link: https://www.nuget.org/downloads
Download latest version of nuget.exe
Replace your .nuget/nuget.exe with this new version.
And try again, I'm confident it will work.
try
nuget update -self
my result:
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 2.8.7.
Updating NuGet.exe to 5.3.1.
Update successful.
This fix worked for me(I am using vs 2013, not sure if it will work for the rest), Go to Tools --> Extensions and Updates, then look for NuGet package manager for visual studio 2013, uninstall it. In the left pane select online which will take you to visual studio gallery, in the right pane search for NuGet package manager for visual studio 2013, it will bring you the right version to install. Install that and you are good to go, hope this sorts someone out.
Install-Package Newtonsoft.Json -Version 6.0.3
I got the same issue and I just clicked on "Restore NuGet package for this solution". In my case this solved the problem. Hope it will help.
I solved this problem, and my steps are as below:
1.Do what as "Mathivanan KP" said;
2.Delete the folder ".nuget", which is below your solution folder;
3.Rebuild your solution;
4.Back to your solution folder, and press "Ctrl + Z", then rebuild your solution again.
If the problem still there, i think you should clone the code from version manager to a new folder, and do the steps as before.
Hope it helpful to you.
You are updating the wrong package. Update your Nuget Package Manager and the error will be gone.
Update-Package NuGet.VisualStudio
https://www.nuget.org/packages/NuGet.VisualStudio
I try everything but nothing helps me. Than I change Visual Studio version from 2012 to 2015 everything is working Like a charm now.

How to install System.Reactive extensions in a Visual Studio 2012 solution?

Visual Studio 2012 has nuget version 2.8.60318.667, that is not compatible with Reactive.Extensions 3.1.1.
If copy manually System.Reactive.* packages into the packages directory of my solution, when I launch the package manager from the Visual Studio UI, and I browse for installed package: instead of habing the list of installed package the following error is displayed:
'System.Reactive.Core' already has a dependency defined for 'System.Reactive.Interfaces'.
nugeterror
If I install package with de package manager command:
install-package System.Reactive
the following error is displayed:
The 'System.Reactive 3.1.1' package requires NuGet client version '2.8.1' or above, but the current NuGet version is '2.8.60318.667'.
Here is the answer I got from the support here:
<<
If you cannot use the System.Reactive. packages, as a temporary workaround you can manually install the old Rx-Main package from the Package Manager Console (I think this is the right arguments):
Install-Package Rx-Main -Version 2.2.5
Unfortunately we are unable to support older versions of NuGet, due to the packaging changes required to support .NET Standard.>>

NuGet fails to find existing package

How it's possible that NuGet's Install-Package fails with Unable to find version 'x' of package 'y' when that exact version is released as NuGet to the official repository and it shown on the https://www.nuget.org/packages/y page.
Here is specific sample with nuget.org content and NuGet Install-Package command output.
UPDATE. Package sources are set to defaults (from nuget.org). Actually, you can see the issue just by running Install-Package Log4Net.Async -Version 1.3.0.
UPDATE 2. I want to highlight that it's not about some developer's machine - the same things happen on Visual Studio Online Hosted Build Controller.
UPDATE 3. Here is how NuGet tries to load package and it looks like NuGet API just broken, because all these requests fail with the error below.
Resource not found for the segment 'Packages'
Also NuGet produces a strange output on NuGet API calls that issued at VS search packages stage, please see here: http://pastebin.com/qveadrZB.
NuGet currently has some service issues related to search and package restore functionality. It is possible this is the cause of your package restore failure.
If other dev machines are working OK, it's likely they have access to a cached version of this package.
Clear your NuGet cache under options -> NuGet Package Manager
I know this thread is very old, but someone who has this problem like me in these days, find my solution for solving such problem here.
I've installed Visual Studio 2012/2015/2017 parallel, and 2012 failed with "package not found error".
So I take a look in the NuGet-settings in VS2017 and found the following package resource:
https://api.nuget.org/v3/index.json
I just added this location to the package resources and vòila, the searched packages where found and installed (in my example the HtmlRenderer).
But be careful with compatibility to Framework 2.0! This setting breaks maybe the functionality to version 2.0!!
Hope this helps someone sometimes somewhere.
Greetings
I'm a latecomer to this thread... I'm in Visual Studio 2017 - 15.9.4
I got this error today trying to pull from my private DevOps NuGet feed
CONTEXT:
the first time I called Install-Package everything worked, but, my NuGet was not assembled right, so, I re-published the NuGet pkg, and
when I tried to update my project that was consuming the pkg, that's
when I got the failure)
Switching my Package Source to "all" alleviated the problem.
After 4 hours struggle I found solution here
https://www.grapecity.com/componentone/docs/uwp/online-getting-started/config-nugetpackage.html
Tools > Options > NuGet Package Manager > Package Sources. > Click add button and add following one by one
nuget.org
https://www.nuget.org/api/v2/
GrapeCity
http://nuget.grapecity.com/nuget
NuGet settings in Visual Studio
Right click on references in your project
Manage NuGet Packages => All
Uninstall affected packages
If this does not resolve the issue, try to remove it from the NuGet config file located at
C:\Users\UserName\AppData\Roaming\NuGet\NuGet.config

Categories

Resources