System.ArgumentException : The input workflow type must be an Activity.
-
Sunday, September 19, 2010 7:22 AM
Hi everyone! I’m getting this error when starting up the workflow:
System.ArgumentException : The input workflow type must be an Activity.
Parameter name: workflowTypeThe code I’m using is shown below:
using (var wf = new WorkflowRuntime()) { wf.WorkflowCompleted += (_, __) => signal.Set(); wf.WorkflowTerminated += (_, __) => signal.Set(); var args = new Dictionary<string, object>(); args.Add("Input", plainText); args.Add("Output", string.Empty); var inst = wf.CreateWorkflow(typeof (HtmlTypography), args); inst.Start(); signal.WaitOne(); return (string) args["Output"]; }
- Dmitri Nesteruk
All Replies
-
Sunday, September 19, 2010 2:54 PMModeratorDo you mean HtmlTypography is indeed a workflow but you are still getting the error? As suggested by the exception, we need the Type of a workflow to be passed to CreateWorkflow(). What is HtmlTypography?
Cecilia Leung This posting is provided "AS IS" and confers no rights or warranties.- Marked As Answer by Andrew_ZhuModerator Friday, September 24, 2010 7:42 AM
- Unmarked As Answer by Dmitri NesterukMVP Saturday, September 25, 2010 2:47 PM
-
Saturday, September 25, 2010 2:50 PM
Not sure who decided to mark this as answer since it's clearly isn't.
I'm passing a very valid Activity into the method.
- Dmitri Nesteruk -
Sunday, September 26, 2010 1:20 AMModerator
Hi Dmitri,
I think the Activity you pass in is an type of System.Activities.Activity , this type is supported from WF 4.
And the WorkflowRuntime is a type from WF 3.5, WorkflowRuntime.CreateWorkflow needs an activity type from
System.Workflow.ComponentModel.Activity.
If you want to use WF4 feature, please use WorkflowApplication/WorkflowInvoker isntead of WorkflowRuntime.
- Proposed As Answer by Jeff Cao Tuesday, October 05, 2010 8:03 PM
- Marked As Answer by Yuanji WangMicrosoft Employee, Moderator Friday, October 08, 2010 1:41 AM

