I have a very simple workflow:

I am trying to create 2 tasks in a replicator.
public sealed partial class Approval_Workflow : SequentialWorkflowActivity
{
public ArrayList Approvers = new ArrayList();
public Approval_Workflow()
{
InitializeComponent();
Approvers.Add(@"test\test");
Approvers.Add(@"test\test2");
}
public Guid workflowId = default(Guid);
public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();
private void createTask_MethodInvoking(object sender, EventArgs e)
{
TaskId = Guid.NewGuid();
TaskProperties.Title = "Review " + workflowProperties.Item.Title;
TaskProperties.DueDate = DateTime.Now.AddDays(1);
}
public Guid TaskId = default(Guid);
public SPWorkflowTaskProperties TaskProperties = new SPWorkflowTaskProperties();
private void replicatorActivity1_ChildInitialized(object sender, ReplicatorChildEventArgs e)
{
((CreateTask)e.Activity).TaskProperties.AssignedTo = e.InstanceData.ToString();
}
}
The createTask_MethodInvoking is hit twice. The first time with the value of TaskProperties.AssignedTo set as test\\test and the second time set as test\test2.
However I have 1 task in my task history list. The second task is not there. In the workflow history I have:
Status: Error Occurred
What could be going wrong? Stepping through the code does not giveany errors.
I added a third user to the Approvers Array List. The code still fails after leaving the createTask_MethodInvoking for a second time.