Question convert json TO c-sharp object(s)

hversemann

Member
Joined
Jul 29, 2016
Messages
11
Location
midwest
Programming Experience
3-5
I working on a test console application which will send a request to a REST API and bring the results back. I know it brings back results in JSON at least and possibly some other formats. This is a test project which I'm playing with just to get familiar with all of the json to C# object conversion stuff, which is all new to me.

The problem I'm having is trying to parse the JSON that is returned with the request, back to one or more C# objects.

So far I've had no success, in getting this to work, in C#.

I've done it before using javascript, but that wasn't in a .NET environment either, and C# and .Net are required for this project.

I'm working in a Visual Studio 2013 Ultimate environment with Visual C# 2013, and ASP.NET web frameworks and tools 2012.2 4.1.21001.0, and ASP.NET web frameworks and tools 2013 5.0.11001.0 and NuGet Package Manager 2.8.60723.765.

I've tried installing the Json.NET (Newtonsoft) package, but it seems to have a dependency of NET.Standard.Library which has a dependency of Microsoft.NetCore.Platforms, which when I try to install it says that it is incompatible, with my console application. So I finally tried installing all of this for my real website application, and all of theses packages seem to fail there as well.

I would appreciate any help or direction that anyone can possibly give me.

Thanks.

Henry
 
Install the newtonsoft package using nuget and it will install dependencies too. After that, using it is a breeze.

Sent from my SM-G935T using Tapatalk
 
Thanks for the helpful suggestion. I had tried previously to install it, but when I tried it, it was with an older version of NuGet. Once I updated NuGet then installing Json.NET package was easy and worked fine then.
 
Back
Top Bottom