I need to deserialize the following YAML to my custom type. YamlAlias attribute seems to be obsolete, so I replaced it with YamlMember. It fails on deserializing the following YAML with the below exception:
host: properties: mem_size: 2048 MB
YamlDotNet.Core.YamlException : (Line: 21, Col: 13, Idx: 524) - (Line: 21, Col: 13, Idx: 524): Exception during deserialization ----> System.Runtime.Serialization.SerializationException : Property 'mem_size' not found on type 'Toscana.Domain.HostProperties'.
public class Host
{
public HostProperties Properties { get; set; }
}
public class HostProperties
{
[YamlMember(typeof(DigitalStorage))]
public string MemSize { get; set; }
}