G
gowthambe91
Guest
I have a requirement where I need to have the property "Encoding" as Data Contract. The Client would be sending "Encoding type" in that, which the service uses for processing the data.
[DataContract]
public class EncodingClass
{
[DataMember]
public Encoding Encodingtype { get; set; }
}
But I get an exception as below,
"The InnerException message was 'Type 'System.RuntimeType' with data contract name 'RuntimeType:http://schemas.datacontract.org/2004/07/System' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer'. Please see InnerException for more details."
Please suggest how can this be made work or is this right way to approach.
Continue reading...
[DataContract]
public class EncodingClass
{
[DataMember]
public Encoding Encodingtype { get; set; }
}
But I get an exception as below,
"The InnerException message was 'Type 'System.RuntimeType' with data contract name 'RuntimeType:http://schemas.datacontract.org/2004/07/System' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer'. Please see InnerException for more details."
Please suggest how can this be made work or is this right way to approach.
Continue reading...