I'm a total FSharp n00b, so I hope i give you enough information. I created a class called record. I create several instances of this class with data from our database. I then add each record to a list of records. i want to make an xml document with those records.
//this is the record data type i created. I also created a sender and recipient data
//type but those are probably not neccessary to understand the issue
type record(id:int, sender:sender, ?recipients: recipient list ) =
let mutable id: int = id
let mutable typ = "Message"
let mutable creation = creation()
let mutable sender = sender
let mutable recipients = recipients
[<XmlIgnore()>]
[<XmlArrayAttribute("recipients")>]
[<XmlArrayItem(typeof<recipient>, ElementName = "recipient")>]
member this.Recipients with get() = recipients and set v = recipients <- v
public new() =
record(12180, sender(12180,"Joe","Plumber","[email protected]"), list.Empty)
[<XmlElement("id")>]
member this.Id with get() = id and set v = id <- v
[<XmlElement("creation")>]
member this.Creation with get() = creation and set v = creation <- v
[<XmlElement("sender")>]
member this.Sender with get() = sender and set v = sender <- v
//i later call this:
let xmlSerializer = XmlSerializer(typeof<record list>)
I then get this error message at runtime:
There was an error reflecting type 'Microsoft.FSharp.Collections.FSharpList`1[XXXX.Compliance.YYYYY.record]'. //x's and y's used to protect the innocent.