I am trying to deserialize a Nullable<bool> from my XML file. My expectation was that a XMLAttribute which was not found in my XMLElement is null and if it's found it will be trueor false. Same for serialization. My variable will be written if it's not null.
Anyways, everytime I'm trying to deserialize my XML an InvalidOperationException will be thrown.
My class looks like this
[XMLArray("Users")]
public class User
{
[XMLAttribute("copy")]
public bool? copy;
}
Any ideas?