Jahangeer
Jahangeer

Reputation: 478

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

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

as mentioned in this thread I've made sure that I'm using 4.0 application and workflow.

Please view the code sample of application for further understanding

Upvotes: 0

Views: 68

Answers (1)

Emran Sadeghi
Emran Sadeghi

Reputation: 612

if you are using wwf 4.0 you cannot use WorkflowRuntime and instead of that you must use WorkflowApplication like :

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

Upvotes: 1

Related Questions