Anyone know of a lightweight YAML library for .NET? Preferably something that comes with source (in C#) so that I can compile it directly into my binary and not have yet another dll dependency.
+7
A:
If your core requirement is "a data-interchange format lighter than XML", then you might want to consider using JSON instead of YAML. YAML is a superset of JSON, but you may not need the extra YAML features.
Both http://yaml-net-parser.sourceforge.net/default.html and YAML for .NET are pretty immature projects, but there is a fairly wide selection of JSON libraries for .NET available, including several with full source code - see the links on the JSON site.
McKenzieG1
2008-09-04 01:50:08
JSON doesn't have a neat, human-readable way to represent multi-line text... except maybe by creating an array with each line a separate element.
Vulcan Eager
2009-09-04 21:28:48
JSON is good news, of course, but those 'extra YAML Features' are just the ones that real human beings need in order to understand the nature and meaning of data! To suggest that JSON is an alternative to YAML seems to trivialise the work and ingenuity that has gone into YAML. How, for example, do you specify the data-type precisely in JSON?
Phil Factor
2010-10-06 08:27:09
A:
This is the best YAML solution for .NET: http://www.codeproject.com/KB/recipes/yamlparser.aspx
You really should take a look at this article.
Eduardo Cobuci
2009-03-10 03:50:27