Describe the bug
I've a XML string that I need to deserialize. The XML contains an array of objects that inherit from BusinessBase. I'm using System.Xml.Serialization.XmlSerializer to deserialize the string and I'm getting an exception:
System.InvalidOperationException
HResult=0x80131509
Message=Cannot deserialize type 'Csla.Rules.BrokenRule' because it contains property 'RuleName' which has no public setter.
Version and Platform
CSLA version: 5.5.3
OS: Windows
Platform: ASP.NET Core 8.0
Code that Fails
new XmlSerializer(type1, extraTypes)
where extraTypes contains an array of types where one of the types are inheriting from BusinessBase
Stack Trace or Exception Detail
System.InvalidOperationException
HResult=0x80131509
Message=Cannot deserialize type 'Csla.Rules.BrokenRule' because it contains property 'RuleName' which has no public setter.
Source=System.Private.Xml
StackTrace:
at System.Xml.Serialization.TypeScope.GetSettableMembers(StructMapping mapping, List`1 list)
at System.Xml.Serialization.TypeScope.GetSettableMembers(StructMapping structMapping)
at System.Xml.Serialization.XmlSerializationReaderILGen.WriteLiteralStructMethod(StructMapping structMapping)
at System.Xml.Serialization.XmlSerializationReaderILGen.GenerateMethod(TypeMapping mapping)
at System.Xml.Serialization.XmlSerializationILGen.GenerateReferencedMethods()
at System.Xml.Serialization.XmlSerializationReaderILGen.GenerateEnd()
at System.Xml.Serialization.TempAssembly.GenerateRefEmitAssembly(XmlMapping[] xmlMappings, Type[] types)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location)
at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace, String location)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, Type[] extraTypes)
Additional context
The XML string I'm deserializing is coming from an external app.
Describe the bug I've a XML string that I need to deserialize. The XML contains an array of objects that inherit from BusinessBase. I'm using System.Xml.Serialization.XmlSerializer to deserialize the string and I'm getting an exception:
Version and Platform CSLA version: 5.5.3 OS: Windows Platform: ASP.NET Core 8.0
Code that Fails new XmlSerializer(type1, extraTypes) where extraTypes contains an array of types where one of the types are inheriting from BusinessBase
Stack Trace or Exception Detail
Additional context The XML string I'm deserializing is coming from an external app.