I'm not sure where the error occurs (from silverlight, from wcf, something else ...), but I have a WCF service called from Silverlight. The method returns a class with a property that does not have setter. This causes an error. If I add the setter property to the property, it will not give an error.
The error is the usual impenetrable and useless Silverlight error message, but ...
[Serializable] [DataContract] public SomeClass { DataMember] public string PropertyA { get; set; } public string PropertyB { get { return "Hi There"; } } }
It gives an error message ...
But change it to:
[Serializable] [DataContract] public SomeClass { [DataMember] public string PropertyA { get; set; } public string PropertyB { get { return "Hi There"; } set {} } }
Error.
Includes the regular class ISomeService.svc and SomeService.svc, links updated in Silverlight, calling the asynchronous client, etc. etc.
What is the correct way to configure a property (any attribute other than "DataMember" to allow get-only or private-set property) to pass it through the wire?
Gene
source share