简体   繁体   中英

Windows Workflow Serialization Error

I am debugging a Windows Workflow workflow. The workflow has a two ReceiveSendReply activities in it. 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
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."

The type 'DataType' is a class generated by EntityFramework and is not even used in the workflow. 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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