简体   繁体   English

Windows工作流序列化错误

[英]Windows Workflow Serialization Error

I am debugging a Windows Workflow workflow. 我正在调试Windows Workflow工作流。 The workflow has a two ReceiveSendReply activities in it. 工作流中有两个ReceiveSendReply活动。 The first one is working as expected. 第一个按预期方式工作。 When the second Receive is executed I get the following error: 当执行第二次接收时,出现以下错误:

Exception:Thrown: "Type '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.
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
异常:抛出:“类型'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.
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
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.
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
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.
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
1[DataType]' cannot be serialized.
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.
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
1 [DataType]'不能为序列化。
Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. 考虑使用DataContractAttribute属性标记它,并使用DataMemberAttribute属性标记要序列化的所有成员。
If the type is a collection, consider marking it with the CollectionDataContractAttribute. 如果类型是集合,请考虑使用CollectionDataContractAttribute对其进行标记。 See the Microsoft .NET Framework documentation for other supported types." 有关其他受支持的类型,请参见Microsoft .NET Framework文档。”

The type 'DataType' is a class generated by EntityFramework and is not even used in the workflow. 类型“ DataType”是由EntityFramework生成的类,甚至没有在工作流中使用。 I don't understand what this message is trying to tell me, so I really don't even know where to start debugging it. 我不明白该消息试图告诉我什么,所以我什至不知道从哪里开始调试它。

Any help would be appreciated. 任何帮助,将不胜感激。

It turned out to be that I was unintentionally returning an EF class from a code activity. 原来是我无意中从代码活动中返回了EF类。 The Type that the error was complaining about was a property of the EF class that was being returned, so that is what made it difficult to find. 错误所抱怨的Type是要返回的EF类的属性,因此很难找到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM