WF4.0 Persistence - NetDataContractSerializer cannot serialize XMLDocument, DataRow - by kulkarni Vani

Status : 


Sign in
to vote
ID 760313 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 8/29/2012 9:55:38 PM
Access Restriction Public


I am using visual studio 2010, .net 4.0 , WF 4.0
I am trying to persist a workflow in sql database using SqlWorkflowInstanceStore
But the persistence of workflow hangs the application as the SqlWorkflowInstanceStore is unable to serialize few type used in the workflow.
Some of them to mention are-
•	XMLDocument 
•	DataRow of a typed in dataset 
As I understand, the NetDataContractSerializer is used to serialize the variable, arguments in workflow.
NetDataContractSerializer could not serialize the XMLDocument and data row.
I want them to persist, how to serialize them using NetDataContractSerializer? how can I do that? 
Also, if I want to ignore some arguments while persisting, how can I do that?
- Adding XMLIgnore, NonSerializable attributes do not work
Error is-
Type 'System.Xml.XmlDocument' 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.

Sign in to post a comment.
Posted by Glenn [MSFT] on 5/7/2013 at 1:11 PM
Since this is an old issue and there is no response, I am going to close it.

Feel free to re-activate it or open another issue if it is still a problem.
Posted by Glenn [MSFT] on 5/1/2013 at 10:41 AM

Is this still an issue for you? If so, are you able to provide a standalone project that reproduces the problem?
Posted by kulkarni Vani on 9/3/2012 at 9:22 PM
This is a blovking issue for us, please reply asap.
Posted by kulkarni Vani on 8/30/2012 at 9:34 PM
i do not want to convert XMLDocument to string and vice versa every time as this can lead to performance hit.

I am passing XML document to many activities in my work flow, every time i cannot afford to convert XMLDocument to string , pass it to an activity, convert it back to XMLDocument again.

Please suggest some other solution.
Posted by Macy [MSFT] on 8/30/2012 at 1:58 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Helen [MSFT] on 8/29/2012 at 10:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(