I ported my WCF code from our main app over to Xamarin and it's compiling perfectly. For WCF we have methods on both the server / clients sides which iterate through the types in the AppDomain which are marked with the DataContract attribute for the purpose of telling WCF which types are known. The code is pretty much exactly the same on the server side as the Xamarin side.
Each of the OperationContracts are marked with this attribute: [ServiceKnownType("GetKnownTypes", typeof(KnownTypeGetter))]
I placed a breakpoint in the method to check that a) it is being called, and b) it is working correctly. It is. The method returns a list of types. Here is a line from the method which should mean that System.Guid is included:
retVal.Add(typeof(Guid));
Here is an OperationContract on the Xamarin side: [OperationContract(AsyncPattern = true)] [ServiceKnownType("GetKnownTypes", typeof(KnownTypeGetter))] [FaultContract(typeof(BLFaultDetail))] [FaultContract(typeof(AdaptFaultDetail))] IAsyncResult BeginGetRecord(string ObjectTypeName, object primaryKeyValue, string transactionId, AsyncCallback callback, object state); IRecord EndGetRecord(IAsyncResult result);
However, when the WCF call is made, WCF is complaining that it doesn't know about Guids. So, it appears that the DataContractSerialiser is not working correctly. Is this perhaps a bug in Xamarin? Or, am I missing something?
Attached is the error message I get.