This worked fine until I converted to Windows compatibility. Now during execution when it gets to the Wait for Form Task and Resume activity, I get this exception:
System.Exception: Type 'System.IO.FileInfo' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.
After doing some research I think I understand what the error means:
- All variables used in the scope of a long-running activity must be serializable. Types of variables listed in this page are serializable: Text, True or False, Number, Array, Date and Time. Data Table and GenericValue variables.
This appears to be trying to explain the solution:
- Variables used in scopes that do not contain long-running activities are not subjected to the serialization requirement, as the workflow does not get suspended in their scope. Non-serializable data types can be used in separate sequence scopes in the same workflow or by invoking other files, as long as they are between Wait and Resume activities, like Wait for Job and Resume, Wait for Queue Item and Resume and Wait for Form Task and Resume.
…but I’m not really sure what it means I have to do.