简体   繁体   English

错误Windows Worklfow Foundation 4.0输入的工作流程类型必须是“活动”。 参数名称:workflowType

[英]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.

相关问题 Windows Workflow Foundation 4.0连接器 - Windows Workflow Foundation 4.0 connector X:工作流基础 4.0 中的名称 - X:Name in workflow foundation 4.0 此类型分配错误是WCF或Windows Workflow Foundation 4.5中的错误吗? - Is this type assignment error a bug in WCF or Windows Workflow Foundation 4.5? Windows Workflow Foundation 3在并行活动中等待 - Windows Workflow Foundation 3 wait inside parallel activity Windows Workflow Foundation-在工作流中的不同活动之间传递自定义变量 - windows Workflow foundation - passing custom variable between different activity in a workflow Windows工作流基础4.0(WPF):如何通过代码更改流程图工作流中的活动位置 - Window workflow foundation 4.0 (WPF): How to change an activity location in a Flowchart workflow by code 如何对Windows Workflow Foundation(WF)活动可以序列化进行单元测试? - How to unit test that a Windows Workflow Foundation (WF) activity can be serialized? Windows Workflow Foundation每隔X分钟重复一次活动 - Windows Workflow Foundation Repeat an Activity Every X minutes Windows Workflow Foundation 4.5接收活动队列行为 - Windows Workflow Foundation 4.5 Receive Activity Queuing Behavior Windows 工作流基础 - 反序列化器无法加载要反序列化的类型,因为类型 - Windows Workflow Foundation - The deserializer cannot load the type to deserialize because type
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM