{Custom activity workflow Debug error} Syntax error in cast operator; two arguments separated by comma are required.

{Custom activity workflow Debug error} Syntax error in cast operator; two arguments separated by comma are required.

Recently I tried to debug a custom activity workflow and I was facing below error.

Unhandled Exception: System.Activities.InvalidWorkflowException: The following errors were encountered while processing the workflow tree:

‘DynamicActivity’: The private implementation of activity ‘1: DynamicActivity’ has the following validation error:   Compiler error(s) encountered processing expression “DirectCast(CustomActivityStep3: Get Url_1_converted, System.String)”.

Basically, I am using two input parameters in my custom activity workflow.

2

So for debugging after above error I have figured out two options to solve my problem.

  1. Remove Input parameters when you are debugging your activity workflow, later you will add for dynamic values.
  2. Or add default values for input parameters.
3
after trying one of the above options I am able to debug my workflow.
For debugging custom activity workflow please refer below links
Hope it’ll help someone.

 

 

Advertisements

One thought on “{Custom activity workflow Debug error} Syntax error in cast operator; two arguments separated by comma are required.

  1. Do you see anything obviously wrong in this code ?
    I am struggling for a while….

    public class WorkflowClassTest : CodeActivity
    {
    [Input(“Dummy Argument”), RequiredArgument]
    [Default(“Guid”)]

    public InArgument DummyArgument { get; set; }

    [Input(“Dummy Argument 2”), RequiredArgument]
    [Default(“EntityLogicalName”)]

    public InArgument DummyArgument2 { get; set; }

    [Output(“Fetch Output”), RequiredArgument]

    public OutArgument FetchOutput { get; set; }

    protected override void Execute(CodeActivityContext executionContext)
    {
    ITracingService tracer = executionContext.GetExtension();
    IWorkflowContext context = executionContext.GetExtension();
    IOrganizationServiceFactory serviceFactory = executionContext.GetExtension();
    IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);

    try
    {
    //DummyArgument = “abc”;

    }
    catch (Exception e)
    {
    throw new InvalidPluginExecutionException(e.Message);
    }
    }
    }

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s