I have this code in my WCF Service:
public class MyImage
{
public Image Image { get; set; }
public string FullPath { get; set; }
}
[ServiceContract]
public interface IMyService
{
[OperationContract] void SaveImage(MyImage myImg);
}
public class MyService : IMyService
{
public void SaveImage(MyImage myImg)
{
// ...
}
}
But this error occur when I run the SaveImage() method:
There was an error while trying to serialize parameter http://tempuri.org/:e. The InnerException message was 'Type 'System.Drawing.Bitmap' with data contract name 'Bitmap:http://schemas.datacontract.org/2004/07/System.Drawing' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'
My code is in C#, Framework 4.0, build in Visual Studio 2010 Pro.
Please help, thanks in advance.