title: Dynamics CRM - Custom Workflow - reading input parameter stops plugin from running?
body: <p>I have a custom workflow activity which accepts an input parameter called "InputTest". This is just a string. </p>
  
  <pre><code>[Input("InputTest")]
  [RequiredArgument]
  public InArgument&lt;string&gt; TargetEntity { get; set; }
  </code></pre>
  
  <p>In my custom workflow activity I want to read it, so I do the following:</p>
  
  <pre><code>string targetEntityValue = TargetEntity.Get(executionContext);
  </code></pre>
  
  <p>As soon as I add that line my workflow activity will no longer execute. When I run it the status will show "Succeeded" but nothing in the workflow will have run, not even the trace at the beginning of the workflow to say the workflow has been entered. There is nothing in the Diag Logs. When I run the SQL Profiler there are only a few statements added to the AsyncBase table showing that the workflow has run and instantly finished. </p>
  
  <p>If I remove the above line the workflow runs ok. I am wondering what I am doing wrong here? Why would reading an input parameter cause CRM not to do anything in the workflow?</p>
  
  <p>It is almost like somehow the code isnt entering its main method.</p>
  
  <pre><code>[Input("Entity")]
  [RequiredArgument]
  public InArgument&lt;string&gt; TargetEntity { get; set; }
  
  protected override void Execute(CodeActivityContext executionContext)
  {
      // Create the tracing service
      ITracingService tracingService = executionContext.GetExtension&lt;ITracingService&gt;();
  
      if (tracingService == null)
      {
          throw new InvalidPluginExecutionException("Failed to retrieve tracing service.");
      }
  
      tracingService.Trace("Entered TestWorkflow.Execute(), Activity Instance Id: {0}, Workflow Instance Id: {1}",
      executionContext.ActivityInstanceId,
      executionContext.WorkflowInstanceId);
  
      string targetEntityValue = TargetEntity.Get&lt;string&gt;(executionContext);
  }
  </code></pre>