Is it possible to use dynamic objects (extending DynamicObject) in WF4 Activity that can be used in expressions?
I get the following error messages when running a unit test that invokes an activity that had a dynamic object as a parameter.
using DynamicObject as the argument type
System.Activities.InvalidWorkflowException : The following errors were encountered while processing the workflow tree: 'Literal': Literal only supports value types and the immutable type System.String. The type System.Dynamic.DynamicObject cannot be used as a literal. 'Legal': The private implementation of activity '1: Legal' has the following validation error: Compiler error(s) encountered processing expression "deal.Region = "EMEA"". 'Region' is not a member of 'System.Dynamic.DynamicObject'.
Using actual type as argument type
System.Activities.InvalidWorkflowException : The following errors were encountered while processing the workflow tree: 'Literal': Literal only supports value types and the immutable type System.String. The type WorkflowTest.DealValueHelper cannot be used as a literal. 'Legal': The private implementation of activity '1: Legal' has the following validation error: Compiler error(s) encountered processing expression "deal.Region = "EMEA"". 'Region' is not a member of 'WorkflowTest.DealValueHelper'.