Hello Overflow,
I am new to Windows Workflow [WF], and interested in evaluating WF for business purposes. I decided to work through an introduction
[TestMethod]
public void TestMethod ()
{
TextWriter writer = new StringWriter ();
Sequence sequence = new Sequence
{
Activities =
{
// so, assigning a reference type [eg StringWriter]
// as target is prohibited in WF4RC. what or how do
// i assign a target? introduction cited above may
// not be current [ie may be Beta2, not RC] so ... ?
new WriteLine { Text = "Hello", TextWriter = writer },
new WriteLine { Text = "World", TextWriter = writer }
}
};
// !!! BLOWS UP !!!
WorkflowInvoker.Invoke (sequence);
}
and encountered
Test method SomeTests.SomeTests.TestMethod threw exception: 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.IO.TextWriter cannot be used as a literal.
Poking around, I found this article describing what appears to be the error I see above.
Being new to WF, I do not really understand the change or proscribed method to work around it. So, my question is,
With WF4RC, how does one [correctly] use WriteLine
activity?