[英]Error Windows Worklfow Foundation 4.0 The input workflow type must be an Activity. Parameter name: workflowType
I'm using windows workflow foundation 4.0 and I've created web Application on my button click event I have the following 我正在使用Windows工作流基础4.0,并且在按钮单击事件上创建了Web应用程序,我有以下内容
Dictionary<string,object> dicobjParams=new Dictionary<string,object>();
WorkflowRuntime workflowRuntime = Application["WorkflowRuntime"] as WorkflowRuntime;
WorkflowInstance instance =workflowRuntime.CreateWorkflow(typeof(Activity1),dicobjParams);
//workflowRuntime.CreateWorkflow(typeof(Activity1), dicobjParams).Start();
workflowRuntime.WorkflowCompleted += new EventHandler<WorkflowCompletedEventArgs>(workflowRuntime_WorkflowCompleted);
instance.Start();
but I always the following error 但我总是以下错误
The input workflow type must be an Activity. 输入的工作流程类型必须为活动。 Parameter name: workflowType 参数名称:workflowType
as mentioned in this thread I've made sure that I'm using 4.0 application and workflow. 如该线程中所述,我已确保使用4.0应用程序和工作流程。
Please view the code sample of application for further understanding 请查看应用程序的代码示例以进一步了解
if you are using wwf 4.0 you cannot use WorkflowRuntime and instead of that you must use WorkflowApplication like : 如果您使用的是wwf 4.0,则不能使用WorkflowRuntime,而必须使用WorkflowApplication来代替:
Dictionary<string, object> dicobjParams = new Dictionary<string, object>();
Activity workflow1 = new MyApp.Activity1();
WorkflowApplication app = new WorkflowApplication(workflow1, dicobjParams );
app.Run();
i recommend to you to read : https://msdn.microsoft.com/en-us/library/ee342461.aspx 我建议您阅读: https : //msdn.microsoft.com/zh-cn/library/ee342461.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.