Hi,
I am getting the belwo erro while trying to convert the Aspose word doc to binary array.
Error: Type ‘Aspose.Words.Document’ in Assembly ‘Aspose.Words, Version=10.0.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’ is not marked as serializable.
This is my code for converting the aspose doc object to binary array:
public byte[] ObjectToByteArray(object _Object)
{
try
{
System.IO.MemoryStream _MemoryStream = new System.IO.MemoryStream();
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter _BinaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();//Error hitting here.
_BinaryFormatter.Serialize(_MemoryStream, _Object);
return _MemoryStream.ToArray();
}
catch (Exception ex)
{
throw ex;
}
return null;
}
Please suggest.
I have to convert the doc object to binary array and pass it through a web service.
Thanks,
Nik