tags:

views:

76

answers:

1

I have class A which has ISerializable implemented for custom serialization. Now i need to pass around this class A in WCF.

I want to use DataContractSerializer for WCF serialization not my custom serialization.

WCF would not allow it, it does not allow [DataContract] atribute if class has ISerializable implemented.

How can i use DataContractSerializer(For WCF) and ISerializer(For Persistance) on same class?

+1  A: 

As is mentioned in the comments, you cannot have both serialization methods.

If you:

  • Place your classes in a separate dll.
  • Reference the dll from both client and server projects.
  • Remove the [DataContract] Attribute.

Then it should work, unless there is something special with respect to how the custom serialization is implemented.

Shiraz Bhaiji
Thanks,I was under impression that datacontract and Iserialization uses different serializer but both are using same.I have been using Iserialization implementation now.
mamu