I would like to keep a custom configuration file for my app and JSON seems like an appropriate format*.
I know that there are JSON libraries for .NET, but I couldn’t find a good comparative review of them. Also, my app needs to run on mono, so it’s even harder to find out which library to use.
Here’s what I’ve found:
I remember reading that there is a built-in way to (de)serialize JSON as well, but I don’t recall what it is.
What library would be easiest to use in mono on linux? Speed isn’t critical, as the data will be small.
*Since the app runs on a headless linux box, I need to use the command line and would like to keep typing down to a minimum, so I ruled out XML. Also, I couldn’t find any library to work with INF files, I’m not familiar with standard linux config file formats, and JSON is powerful.
The DataContractJsonSerializer can handle JSON serialization but it’s not as powerful as some of the libraries for example it has no Parse method.
This might be a way to do it without libraries as I beleive Mono has implemented this class.
To get more readable JSON markup your class with attributes: