Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在Xamarin.iOS中将DataContractSerializer替换为Protobuf网络序列化程序_C#_Wcf_Xamarin.ios_Protobuf Net - Fatal编程技术网

C# 如何在Xamarin.iOS中将DataContractSerializer替换为Protobuf网络序列化程序

C# 如何在Xamarin.iOS中将DataContractSerializer替换为Protobuf网络序列化程序,c#,wcf,xamarin.ios,protobuf-net,C#,Wcf,Xamarin.ios,Protobuf Net,我有使用protobuf net作为序列化程序的WCF服务和必须使用此服务的Xamarin.iOS应用程序 我已经为我的DTO类创建了预编译序列化程序,但我不知道如何替换monotouch(Xamarin.iOS)客户端应用程序中的DataContractSerializer,因为ProtoBehaviorExtension是从BehaviorExtensionElement继承的,这在ServiceModel 2中不可用 @马克·丹尼尔在回答中说: 但是,如果您从GitHub上的Mono存储库

我有使用protobuf net作为序列化程序的WCF服务和必须使用此服务的Xamarin.iOS应用程序

我已经为我的DTO类创建了预编译序列化程序,但我不知道如何替换monotouch(Xamarin.iOS)客户端应用程序中的DataContractSerializer,因为ProtoBehaviorExtension是从BehaviorExtensionElement继承的,这在ServiceModel 2中不可用

@马克·丹尼尔在回答中说:

但是,如果您从GitHub上的Mono存储库获取完整的System.ServiceModel,并根据完整的Protobuf源代码构建它,那么您就可以让它工作;我已经这样做了

有人能告诉我们更多关于如何从Mono中提取完整System.ServiceModel并使用Protobuf构建它的信息吗


在wcf客户机中,是否有其他方法可以序列化/反序列化数据?

当然,另一种方法是使用常规端点(可能在某处添加第二个端点),该端点仅将数据作为
字节[]
传递,并分别担心序列化/反序列化。“没那么漂亮,但它应该有用。”MarcGravel谢谢你的建议,它真的有用。但在本例中,我们同时使用两个序列化程序。对我来说,从客户机中排除DataContractSerializer很重要。