Wednesday, 6 March 2013

WCF DataMember attribute issue

Got caught out by this issue today. Spent ages trying to find out why I was getting a WCF exception after adding the DataContract and DataMember attributes into my class, and it turned out I had a property that didn't have both a getter and a setter declared.

image

http://msdn.microsoft.com/en-gb/library/system.runtime.serialization.datamemberattribute.aspx

The error was simply reported as

System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue

No comments:

Post a Comment

How to find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...