Restsharp: Error installing package

Created on 13 Jul 2015  ·  24Comments  ·  Source: restsharp/RestSharp

I'm trying to install RestShare in my Windows 8.1 universal app (has desktop and phone components), but I keep getting this error:

"Could not install package 'RestSharp 105.1.0'. You are trying to install this package into a project that targets '.NETCore,Version=v4.5.1', 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 can tell from web sites, RestSharp should support .Net 3.5+. Is there something I'm missing?

investigate

Most helpful comment

I've some error

Could not install package 'RestSharp 105.2.3'. You are trying to install this package into a project that targets 'WindowsPhoneApp,Version=v8.1', but the package does not contain any assembly references or content files that are compatible with that framework.

I'm working on Vs.2015, win 10, x64

tks

All 24 comments

I have a same issue with blank portable xamarin project on VS 2015 RC

"Could not install package 'RestSharp 105.1.0'. You are trying to install this package into a project that targets '.NETPortable, Version=v4.5, Profile=Profile78', 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"

@boskiv the issue you're having is because the RestSharp nuget package does not contain binaries for for the .NETPortable library.

@millerds there should be binaries for 4.5.1 in the nuget package already. Can you verify which project is having the issue and let me know what each project in your solution that's referencing the library targets (from the project properties)?

So this is my first time trying out the Windows 8.1 universal template in VS 2013. There are two app projects (one for desktop and one for phone) and a shared code "project" (which apparently gets added to each of the other two projects at compile time). I noticed the Project Manager Console allows me to target each project when running the Install-Package comment. When targeting the desktop project (the default) I get the error above. When targeting the phone project I get the same error but the target framework indicated is 'WindowsPhoneApp,Version=8.1'. I can't target the shared project.

When I look at the properties page for each app project I don't see a listing for a .Net target on the application tab as I was expecting, but instead they just show an OS target. The desktop app project says target is Windows 8.1, and the phone app project says target is Windows Phone 8.1. No way to change either of them.

Interesting. I don't do much if any windows phone development so I'll have to try this out locally and see what I can do to get it fixed. Thanks for letting me know.

FYI . . . I just now tried some other project types on the same machine and found that the Store Apps projects are the ones with the trouble (even with just a windows app . . . no phone). If I make a Windows Desktop project then it installs fine. Hope that helps figuring it out.

Thanks that does help.

I'm seeing the same issue in VS2015 (RC) doing Windows 10 Universal App Development. Have the same issue with the portable version.

Error:

Severity    Code    Description Project File    Line
Error       Could not install package 'RestSharp 105.1.0'. You are trying to install this package into a project that targets 'Windows, Version=v8.1', 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.         0

@o0rebelious0o there wouldn't be targeting in nuget for that yet which is why you're getting that error. I don't have any of that installed locally and since it's not a full RTM or GM yet it's not a priority.

hi.
test in win 8.1 x64 not work.

@AhrimanSefid I run that environment to build and test and it works fine. it's got more to do with the project you're trying to install the package for.

VS 2015 test Not Work

If you trying to build rest sharp in VS 2015 you need to make sure you have all the project targets for windows phone and silver light installed as well. Since VS 2015 was just release as RTM I have not tried to build the library using it yet.

I'm trying to install the RestShare Nuget Package to my Cross Platform Project (iOS & Android) and I get this error:

Could not install package 'RestSharp 105.1.0'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', 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.

@rainergp we don't support cross platform projects yet. the way the library is constructed we can only target a single platform at a time. there is a new version up on nuget currently that will target some of those types directly.

the new version should fix all of this now

Can you suggest which version of Restsharp is compatible for PCL i.e. targeting multiple platforms? I tried 105.2.3 version but I still can't add this version library into my PCL. My platforms are iOS, Android, .net 4.5 and Windows Phone 8.1 and I use Xamarin.

@krunalc Right now there is no support for targeting multiple platforms.

I've some error

Could not install package 'RestSharp 105.2.3'. You are trying to install this package into a project that targets 'WindowsPhoneApp,Version=v8.1', but the package does not contain any assembly references or content files that are compatible with that framework.

I'm working on Vs.2015, win 10, x64

tks

Reporting the Same error, on VS15: "Severity Code Description Project File Line Suppression State Error Could not install package 'RestSharp 105.2.3'. You are trying to install this package into a project that targets 'Windows,Version=v8.1', 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. 0"

I have the same issue when trying to install the package in a .NETCoreApp,Version=v2.1...

@george-weare8 what package?

@george-weare8 so, you are are getting the error

Could not install package 'RestSharp 105.1.0'. You are trying to install this package into a project that targets '.NETCore,Version=v4.5.1', 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.

when installing it to your .NET Core 2.1 project? I am very confused.

Sorry for the confusion, I've created a new issue.
https://github.com/restsharp/RestSharp/issues/1314

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Taher-Assad picture Taher-Assad  ·  5Comments

instriker picture instriker  ·  7Comments

ghd258 picture ghd258  ·  6Comments

vDeggial picture vDeggial  ·  6Comments

maximuss picture maximuss  ·  3Comments