Two months later: The YAML file (Eve Online blueprint.yaml), which I was trying to analyze, changed a huge deal, which also simplified the analysis with a deserializer. If someone (for some reason) would like to see the code, it was updated at https://github.com/hkraal/ParseYaml
Based on Steve Wellens comment, I adjusted the code to do fewer things at once. It did not matter in the error itself. I created another project (Example1) in my solution to check the actual example found on aaubry.net, which I referenced earlier.
This gave me the same error when using the "dynamic" key, which led to my current output: There is a difference between:
items:
- part_no: A4786
and
items:
part_no: A4786
, () , .yaml , .
, "" , yaml...
# , , , . , Yaml. - YamlBlueprint, YamlBlueprint.cs, Yaml.
github, :
https://github.com/hkraal/ParseYaml
http://www.aaubry.net/page/YamlDotNet-Documentation-Loading-a-YAML-stream , . , , myKey YamlScalarNode() , .
var items = (YamlSequenceNode)mapping.Children[new YamlScalarNode(myKey)];
, :
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'.
"items" YamlScalarNode() , , . , , .