【发布时间】:2015-02-04 19:58:21
【问题描述】:
我正在调试 Windows Workflow 工作流。工作流中有两个 ReceiveSendReply 活动。第一个按预期工作。执行第二个 Receive 时,出现以下错误:
异常:抛出:“类型 'System.Data.Linq.EntitySet1[DataType]' cannot be serialized.
Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.1[DataType]' 无法序列化。
考虑使用 DataContractAttribute 属性对其进行标记,并使用 DataMemberAttribute 属性标记您想要序列化的所有成员。
If the type is a collection, consider marking it with the CollectionDataContractAttribute.
See the Microsoft .NET Framework documentation for other supported types." (System.Runtime.Serialization.InvalidDataContractException)
A System.Runtime.Serialization.InvalidDataContractException was thrown: "Type 'System.Data.Linq.EntitySet
如果该类型是一个集合,请考虑使用 CollectionDataContractAttribute 对其进行标记。有关其他支持的类型,请参阅 Microsoft .NET Framework 文档。”
“DataType”类型是由 EntityFramework 生成的类,甚至没有在工作流中使用。我不明白这条消息试图告诉我什么,所以我什至不知道从哪里开始调试它。
任何帮助将不胜感激。
【问题讨论】:
标签: c# linq entity-framework serialization workflow-foundation