我可以使用它代替可序列化的数据契约吗?



I create service.cs by slSvcUtile.exe for Xamarin.Forms 但我得到错误:

在命名空间"System.Runtime.Serialization"中找不到类型名称"DataContractAttributeAttribute"。此类型已转发到程序集"System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" 请考虑添加对该程序集的引用。

我可以使用它代替可序列化的数据契约吗?

您似乎缺少对库的引用。您可以尝试使用/r.dll 添加 System.Runtime.Serialization.dll您可能需要指定它的完整路径。

详细操作方法在这里https://msdn.microsoft.com/en-US/Library/cc197958(v=vs.95(.aspx

最新更新