I am working on a cross-platform application (using Xamarin) that interacts with a server application. These two applications must exchange data using the TCP protocol, and for this I need to make some classes Serializable.
So what I want to do is install these classes in a portable class library so that it can be referenced using both my cross-platform application and the server.
The problem I am facing is that labeling the Serializable class is not possible in PCL. I tried downloading the Microsoft.NET Portable Library Assemblies Link Collections and adding a link to the DLL, but it says that they are already referenced by default.
[Serializable]
public struct Product
{
[XmlAttribute(AttributeName = "Name")]
public string Name { get; set; }
[XmlAttribute(AttributeName = "Id")]
public int Id { get; set; }
[XmlAttribute(AttributeName = "Price")]
public double Price { get; set; }
[XmlAttribute(AttributeName = "Brand")]
public string Brand { get; set; }
}
, Serializable PCL?