0
votes

I have just create a cross platform application in Xamarin. I created one function in a shared project in which it deserializes the JSON string into object/s but there is no way to add reference for Newtonsoft .

how can i use the reference in shared project ?

2

2 Answers

3
votes

If you are using VS just click on tool-> Nuget package manager -> Manage Nuget package for solution and Install Newtonsoft.json after select all the platform in checkbox.

Now you can use it in your share project also.

2
votes

In a shared project you'll use the references that are in the Android or iOS project. Thats why it's a shared project. Just add the refrence from nuget to your Android and iOS project and you should be good.

For more information: https://developer.xamarin.com/guides/cross-platform/application_fundamentals/shared_projects/