0
votes

I want to use restSharp for my project into visual studio for Xamarin, but I got this error :

Installing 'RestSharp 105.0.0'. Successfully installed 'RestSharp 105.0.0'. Adding 'RestSharp 105.0.0' to Wikeepet. Uninstalling 'RestSharp 105.0.0'. Successfully uninstalled 'RestSharp 105.0.0'. Install failed. Rolling back... Could not install package 'RestSharp 105.0.0'. You are trying to install this package into a project that targets 'portable-net45+win+wpa81+wp80+MonoAndroid10+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.

My projet is a Mobile apps : Blank Apps (Xamarin.forms Portable)

Any help is appreciated.

1
Are you trying to install this to your PCL? My guess is that you are only able to install this to your WP8 / iOS / Android projects. Not your PCLUser1
@user1 Hum yes I'm trying to install this into my PCL. But if I don't and I install it in WP8/iOS/Android, I will have to develop 3 different code ? Or I don't get how to share my code into my 3 application.Nicolas_LeBot
I don't know a lot about restsharp. But it seems to me like they havent implemented a pcl version of their library. One way to do it would be to build an interface in your pcl and implement it in the three different projects to expose the features of restsharp you would like to use. You would then use that interface in your pcl to use the relevant restsharp methodsUser1
Oh yeah, I always forget to use interface. I think it could be a good idea ! Thanks @user1 !Nicolas_LeBot

1 Answers

0
votes

So I found the answer, thanks to User1 in the comments upstair.

The answer is easy : There is nothing for RestSharp in a PCL. If I want to use RestSharp, you need a interface or just install 3 references and coding few lines into each projects !