I have a class with 2 attributes on it, "DataContract" and "Serializable". This class is being used in a service. This service is being consumed by a project. I have added the reference of the service in the project by using the "add service reference" functionality of VS (Right Click on references -- Add -- Service Reference). Whenever I add the reference of the service, duplicate properties of the class is created in the Reference.cs file of the service reference, 1 with "DataMember" attribute and other with "Serializable" attribute. This is causing a build error. If I do not put the Serializable attribute, the service reference works fine with just 1 set of properties of the class with "DataMember" attribute.
Any idea why is this happening and what can we do to avoid this? Please note that both the attributes are required for the class i.e. I cannot remove any of the attributes.