title: Custom Sandboxed Workflow Activity Issues
body: <p>I have a custom SharePoint sandboxed workflow activity that I am trying to pass an optional parameter to. However, ULS gives me the following exception message:</p>
  
  <blockquote>
    <p>"SJW.SPDActivities.SendEmailWithAttachment.SendEmailWithAttachmentActivity" of type "SendEmailAttachment" failed. The method contains a parameter named "RecipientCC" but the parameters dictionary does not contain a value of this parameter.</p>
  </blockquote>
  
  <p>My guess is that SPUserCodeWorkflowActionWrapper is using some sort of reflection to bind parameters to my sandboxed workflow method. However, because one of them is declared as optional in my Elements.xml file (RecipientCC), it is unable to find a value to bind and thus throws an exception.</p>
  
  <p>Any idea how to get around this wonky behavior? Do I have to declare all my parameters to be mandatory?</p>
  
  <p>My Elements.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
    &lt;WorkflowActions&gt;
      &lt;Action Name="Send an Email with an Attachment"
              SandboxedFunction="true"
              Assembly="$SharePoint.Project.AssemblyFullName$"
              ClassName="SJW.SPDActivities.SendEmailWithAttachment.SendEmailWithAttachmentActivity"
              FunctionName="SendEmailAttachment"
              AppliesTo="all"
              Category="SJW Custom Actions"&gt;
        &lt;RuleDesigner Sentence="Email %1 with attachment %2"&gt;
          &lt;FieldBind Field="RecipientTo,RecipientCC,Subject,Body" Text="these people" Id="1" DesignerType="Email"/&gt;
          &lt;FieldBind Field="AttachmentListID,AttachmentListItem" Text="file" Id="2" DesignerType="ChooseDoclibItem"/&gt;
        &lt;/RuleDesigner&gt;
        &lt;Parameters&gt;
          &lt;Parameter Name="__Context" Type="Microsoft.SharePoint.WorkflowActions.WorkflowContext, Microsoft.SharePoint.WorkflowActions" Direction="In" DesignerType="Hide"/&gt;
          &lt;Parameter Name="RecipientTo" Type="System.Collections.ArrayList, mscorlib" Direction="In"/&gt;
          &lt;Parameter Name="RecipientCC" Type="System.Collections.ArrayList, mscorlib" Direction="Optional"/&gt;
          &lt;Parameter Name="Subject" Type="System.String, mscorlib" Direction="In"/&gt;
          &lt;Parameter Name="Body" Type="System.String, mscorlib" Direction="In"/&gt;
          &lt;Parameter Name="AttachmentListID" Type="System.String, mscorlib" Direction="In"/&gt;
          &lt;Parameter Name="AttachmentListItem" Type="System.Int32, mscorlib" Direction="In"/&gt;
        &lt;/Parameters&gt;
      &lt;/Action&gt;
    &lt;/WorkflowActions&gt;
  &lt;/Elements&gt;
  </code></pre>
  
  <p>My method declaration:</p>
  
  <pre><code>public Hashtable SendEmailAttachment(SPUserCodeWorkflowContext context,
                                       ArrayList RecipientTo,
                                       ArrayList RecipientCC,
                                       string Subject,
                                       string Body,
                                       string AttachmentListID,
                                       int AttachmentListItem)
  </code></pre>