I have an exe file I wrote in .NET which I want to read a .json file from a URI, and return a value in string format. I am pretty new to .NET and c# but can easily do this in PowerShell (using Invoke-RestMethod). I don't want to use an external library such as json.net (would like to distribute this as a single .exe). The only thing I found so far was System.Runtime.Serialization.Json - which looks like it will work but also seems extremely complex and difficult to use. Is this the library I should be using to perform this simple task? Is there an easier way to do this?
3 Answers
System.Runtime.Serialization.Json really isn't all that bad. Yes, it is the library you should use if you don't want to go third-party.
The exception to this is if your JSON is trivial. If it's trivial, just do the string parsing yourself.
1 Comment
Progger
The JSON has just a few objects. I can definitely parse it myself with much less code. I will do that.