Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with RestSharp installation in Visual-Studio 2013

I am trying to use RestSharp in my C# Visual-Studio 2013 project to POST data at a given URL. When i try to install the package via NuGet it gives me the following error:

Installing 'RestSharp 106.1.0'.
Successfully installed 'RestSharp 106.1.0'.
Adding 'RestSharp 106.1.0' to WebApplicationJson.
Uninstalling 'RestSharp 106.1.0'.
Successfully uninstalled 'RestSharp 106.1.0'.
Install failed. Rolling back...
Could not install package 'RestSharp 106.1.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', 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.

As far as I have read in GitHub this is mostly an issue for .NetPortable framework so I am out of ideas. I have also tried to change my framework version to 3.5 but still the same error.

Has anyone encountered a similar issue?

If you need further information please comment.

like image 700
Noel Avatar asked Dec 05 '17 10:12

Noel


People also ask

How do I add a RestSharp reference in Visual Studio?

Use NuGet to install RestSharp. To do that Right click on the Project or Solution file in Solution Exporter and select Manage NuGet packages. Search for it in there and install it. work perfect thanks !

What is RestSharp DLL?

RestSharp is a comprehensive, open-source HTTP client library that works with all kinds of DotNet technologies. It can be used to build robust applications by making it easy to interface with public APIs and quickly access data without the complexity of dealing with raw HTTP requests.


1 Answers

The latest version, which supports old .NET Framework versions, is 105.2.3.

Install-Package RestSharp -Version 105.2.3

Since the lowest .NET Framework LTE, which supports async methods is 4.5.2, support of legacy framework has been removed in favour of supporting .NET Standard 2.0 (and .NET Framework 4.5.2).

like image 107
Alexey Zimarev Avatar answered Oct 27 '22 06:10

Alexey Zimarev