Right now I am trying to convert a YAML file into a hash table, utilizing the Deserializer that is provided in the YamlDotNet library. Getting the error Excpected 'SequenceStart' got 'MappingStart'
.
var d = Deserializer();
var result = d.Deserialize<List<Hashtable>>(new StreamReader(*yaml path*));
foreach (var item in result)
{
foreach (DictionaryEntry entry in item)
{
//print out using entry.Key and entry.Value and record
}
}
The YAML file structure looks like
Title:
Section1:
Key1: Value1
Key2: Value2
Key3: Value3
Sometimes containing more than one section.
I have tried a solution similar to this Seeking guidance reading .yaml files with C# as well, however the same error occurs. How do I properly read in a YAML file, and convert it into a hash using YamlDotNet?