YamlDotNet
YamlDotNet copied to clipboard
Nullable structs processing
Hi!
I have an issue with YamlDotNet and dont understand how to resolve it. The code is:
public class SomeClass
{
public SomeStruct? Struct { get; set; }
}
public struct SomeStruct
{
public int Value { get; set; }
}
public static void Test()
{
var s = new YamlDotNet.Serialization.SerializerBuilder().Build();
var yaml = s.Serialize(new SomeClass
{
Struct = new SomeStruct { Value = 42 }
});
var d = new YamlDotNet.Serialization.DeserializerBuilder().Build();
var i = d.Deserialize<SomeClass>(yaml);
}
This code is throwing exception: SerializationException: Property 'Value' not found on type 'System.Nullable`1[[SomeStruct]]
Is there any workaround for parsing such structure?
Thanks!
I'm running into the same issue on 8.1.2:

I'm also running into this issue. Any advice @aaubry ?
A fix for this issue has been released in version 11.2.1.