【发布时间】:2013-08-27 14:18:02
【问题描述】:
我使用的是 Windows Workflow Foundation 4.5。
我想将参数传递给 WriteLine 活动。代码如下:
class Program
{
static void Main(string[] args)
{
WriteLine wf1 = new WriteLine();
wf1.Text = "arg1";
Dictionary<String, Object> arg = new Dictionary<String, Object>();
arg.Add("arg1", "Hello,world!");
WorkflowInvoker.Invoke(wf1, arg);
}
}
但我在运行时收到以下错误:
Unhandled Exception: System.ArgumentException: The values provided for the root activity's arguments did not satisfy the root activity's requirements: 'WriteLine': The following keys from the input dictionary do not map to arguments and must be remove d: arg1. Please note that argument names are case sensitive.
那么正确的做法是什么?
【问题讨论】:
标签: workflow workflow-foundation-4