2

I'm working with RESTful webservice, getting error while adding package "System.Net.Http";

"The 'System.Net.Http 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.5.0'. "

So, to resolve above error i'm trying to install "NuGet client" from "Add Package" option in xamarin studio, but this time I'm facing another issue that is;

"Could not install package 'NuGet.Client 3.2.0'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoAndroid10+xamarinios10+MonoTouch10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author."

please help to resolve this issue.

priyanka kamthe
  • 519
  • 2
  • 5
  • 19

3 Answers3

3

Xamarin Studio currently does not support NuGet 3. It is currently only supported in Visual Studio 2015.

It is not possible to upgrade Xamarin Studio so it supports NuGet 3 at this time. Installing the NuGet.Client NuGet package does not upgrade NuGet in Xamarin Studio.

I would instead look at using the Microsoft.Net.Http NuGet package which you can install into a portable class library project (PCL) and supports all Xamarin Android and Xamarin iOS projects.

Matt Ward
  • 47,057
  • 5
  • 93
  • 94
2

I was able to grab a copy of System.Net.Http.dll from another project and manually add it as a reference to my Xamarin project. I put it in the packages folder and then browsed to it from the edit references dialog.

Rod Hartzell
  • 420
  • 3
  • 9
1

For people facing problem trying to add System.Net.Http...

I was able to solve the problem by using Microsoft.Net.Http instead of System.Net.Http. In Xamarin studio, Right click on your project > Add > Add NuGet Packages.. > search for "Microsoft Http Client Libraries" and click Add Package.

Drunken Daddy
  • 7,326
  • 14
  • 70
  • 104