Unknown identifier "DataContractSerializer"

611 views Asked by At

I am in total confusion. I am learning to use DataContractSerializer class by following the example and my compiler keeps saying that it doesn't exist. Isn't DataContractSerializer in System.Runtime.Serialization namespace? Or do you also have to include the reference to the namespace in your project along with its uses clause?

Here is the code:

var theSerial := new DataContractSerializer(typeof(sb));

sb is a record.

Thanks in advance,

1

There are 1 answers

0
ThN On BEST ANSWER

I figured out the problem. Yes, you do need to add reference to System.Runtime.Serialization not just under uses clause apparently.