- Home /
Read JSON from URL using JsonFx
I am trying to get the JSON data from the given URL and add that readable into the Local list. For that I am using JsonFx library. Here what I did is download JsonFx.dll from the web and Add it as a Reference to the Assembly -CSharp Project by using Visual Studio.
using JsonFx.Json; //After adding reference in Reference folder
But this throws the Error in Unity
error CS0246: The type or namespace name `JsonFx' could not be found. Are you missing a using directive or an assembly reference?
Guys please help me, how to use JsonFx in unity. Any examples ?. Thanks in Advance.
Just if you search for a JSON parser generator, you might want to use SimpleJSON. It has no dependencies to external libraries and is just a single file.
Answer by billykater · Nov 05, 2013 at 09:19 PM
First a basic rule: Never modify the generated Assembly-xxx projects. These are managed by unity and will be overridden each time unity wants to change something.
For your specific problem. Just drop any dll you want to use with unity directly somewhere into your Assets folder. It will be picked up and deployed automatically.
Answer by piotrpo · Nov 05, 2013 at 09:54 PM
create lib directory in you assets directory (I'm not sure if the name is strict - my works)
place .dll into it
Be sure to get the right version of JsonFX lib - https://github.com/opless/JSonFx.Json
Answer by zertach · Nov 06, 2013 at 09:06 AM
I prefer use LitJson. But if would you like to use JsonFx than import your dll into directly assets folder. And in player settings change framework .net 2.0 subset to .net 2.0
$$anonymous$$y target framework is 3.5. And you were right. LitJSON is quite better support for iOS platform. I solved my problems at all. Thanks brothers.