【问题标题】:Windows Workflow Serialization ErrorWindows 工作流序列化错误
【发布时间】: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.
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]' 无法序列化。 考虑使用 DataContractAttribute 属性对其进行标记,并使用 DataMemberAttribute 属性标记您想要序列化的所有成员。
如果该类型是一个集合,请考虑使用 CollectionDataContractAttribute 对其进行标记。有关其他支持的类型,请参阅 Microsoft .NET Framework 文档。”

“DataType”类型是由 EntityFramework 生成的类,甚至没有在工作流中使用。我不明白这条消息试图告诉我什么,所以我什至不知道从哪里开始调试它。

任何帮助将不胜感激。

【问题讨论】:

    标签: c# linq entity-framework serialization workflow-foundation


    【解决方案1】:

    结果是我无意中从代码活动中返回了一个 EF 类。错误所抱怨的 Type 是返回的 EF 类的属性,因此很难找到。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-10-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-28
      • 2016-10-11
      • 2015-07-22
      相关资源
      最近更新 更多