title: Seeking guidance reading .yaml files with C#
body: <p>Two months later:
  The YAML (Eve Online blueprint.yaml) file I tried to parse changed a huge deal which also made it much easier to parse using de deserializer. If someone (for whatever reason) would like to see the code, it's updated on <a href="https://github.com/hkraal/ParseYaml" rel="nofollow">https://github.com/hkraal/ParseYaml</a></p>
  
  <hr>
  
  <p>Based on the comment of Steve Wellens I've adjusted the code to do less things at once. It didn't matter in the error itself. I've created another project (Example1) in my solution to test the actual example found on aaubry.net I referenced to earlier.</p>
  
  <p>It gave me the same error when using an "dynamic" key which lead to my current conclusion:
  There is a difference between:</p>
  
  <pre><code>items:
      - part_no:   A4786
  </code></pre>
  
  <p>and</p>
  
  <pre><code>items:
      part_no:   A4786
  </code></pre>
  
  <p>The first is being used in the example which I (wrongly) assumed I could apply to my .yaml file which is using the second syntax.</p>
  
  <p>Now it remains to find out how I can get the 'child' elements of my key with the syntax used in my yaml file...</p>
  
  <hr>
  
  <p>As C# is used at work I started thinking about a nice project to learn about various aspects of the language while having a direct goal to work towards. However I'm hitting my first wall quite early in my  project parsing a Yaml file. My goal is to create an List of YamlBlueprint objects as defined in YamlBlueprint.cs but I don't even get to the end of the Yaml file.</p>
  
  <p>I've setup a testcase on github which demonstrates the problem:
   <a href="https://github.com/hkraal/ParseYaml" rel="nofollow">https://github.com/hkraal/ParseYaml</a></p>
  
  <p>The example on <a href="http://www.aaubry.net/page/YamlDotNet-Documentation-Loading-a-YAML-stream" rel="nofollow">http://www.aaubry.net/page/YamlDotNet-Documentation-Loading-a-YAML-stream</a> works up untill I want to loop trough the items. Based on what I see I should be able to give myKey as parameter to the YamlScalarNode() to access the items below it.</p>
  
  <pre><code>var items = (YamlSequenceNode)mapping.Children[new YamlScalarNode(myKey)];
  </code></pre>
  
  <p>I'm gettting the following error if I do:</p>
  
  <pre><code>An unhandled exception of type 'System.InvalidCastException' occurred in yamldotnet.exe
  Additional information: Unable to cast object of type 'YamlDotNet.RepresentationModel.YamlMappingNode' to type 'YamlDotNet.RepresentationModel.YamlSequenceNode'.
  </code></pre>
  
  <p>When passing "items" as parameter to YamlScalarNode() it just complains about the item not being there which is to be expected. As I'm not sure where my toughttrain is going wrong I would love a bit assistance on how to troubleshoot this further.</p>