我正在调试Windows Workflow工作流程。工作流在其中有两个ReceiveSendReply活动。第一个是按预期工作。执行第二次Receive时,我收到以下错误:
异常:抛出:“类型'System.Data.Linq.EntitySet 1[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 [数据类型]'无法序列化。
请考虑使用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生成的类,甚至不在工作流中使用。我不明白这条消息试图告诉我什么,所以我真的不知道从哪里开始调试它。
任何帮助都将不胜感激。
答案 0 :(得分:0)
原来,我无意中从代码活动中返回了EF类。错误所抱怨的Type是正在返回的EF类的属性,因此很难找到它。