- Home /
How to include RestSharp For Unity3D
Hello Everyone :),
I'm trying to build a VRNews Application using Unity 5. The final App Should run under Android and I want to acces NY Times API with a RESTRequest to get my news. I found RestSharp in the normal NuGet Packet Manager but if i try to install it I get the following error message:
"Error Could not install package 'RestSharp 105.2.3'. You are trying to install this package into a project that targets '.NETFramework,Version=v3.5,Profile=Unity Subset v3.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."
But there is a Version for Unity3D ( https://github.com/Cratesmith/RestSharp-for-unity3d ), but I have no idea how I should include it into my project. The folder contains several .sln Files, the overall structure is as follows:
I'd like to include a version that works for debugging on my pc and the android version, could you help me on how to include this RestSharp Version into Unity? I also noticed that it is quiet dated, I hope it's even possible to include it into Unity 5.
Thank you very much, Max
Answer by theLittleSettler · Nov 29, 2015 at 02:04 AM
The gist of it is you need a dll (or whatever) supporting .net 3.5 . Looking at that...I can't see anything compiled and ready to go, but it should be pretty straight forward to download and compile it through visual studio (or is that a monodev project?...one of them)
Then include that compliled library in your assets folder and add a reference to it in your ide.
Edit: missed the bit about debugging... I'm not sure about that, but I'd give the android one a shot. They must have some way of running on pc for developing it. It might be easier to test that outside of the unity project. Should there be something that works for windows, but not for andoid, you could use unity's compile directives to make that happen...ie
#if UNITY_EDITOR
// some solution that works on windows
#else
// android code
#endif
Sorry I can't be more specific :/
Thank you for your answer it was very helpful.
I compiled the mono Solution in $$anonymous$$onoDevelop and just put the .dll-files inside my asset folder and that's it. I normally use c++ and i was expecting some trouble with .lib's and include directories and so on but c# seems to be a lot smarter in those points. I'll have to check if RestSharp is working on Android though.
Cheers, $$anonymous$$ax
Your answer
Follow this Question
Related Questions
How to add post from wordpress in unity? 0 Answers
Reading JSON response from Google Sheets in unity ( most places have WWW.text) 1 Answer
UnityWebRequest.Post with MultipartFormDataSection returns Bad Request (400) 0 Answers
Javascript in Unity, Including iPhone API's (Objective C?) 2 Answers
Where to market my games without API requirements ? 1 Answer