tags:

views:

1647

answers:

4
+7  Q: 

.NET YAML Library

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.

+2  A: 

Have you looked at YAML for Net?

Will
+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
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
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
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