I'm getting the following error when I click on the "create order" button in the "OrderStateMachine" sample application.
System.Workflow.Activities.EventDeliveryFailedException was unhandled
Message="Event \"OrderCreated\" on interface type \"Microsoft.Samples.Workflow.OrderApplication.IOrderService\" for instance id \"c9b23d5e-9855-428d-9bd4-e0aa903a96bf\" cannot be delivered."
Source="System.Workflow.Activities"
StackTrace:
at System.Workflow.Activities.WorkflowMessageEventHandler.EventHandler(Object sender, ExternalDataEventArgs eventArgs)
at Microsoft.Samples.Workflow.OrderApplication.OrderService.RaiseOrderCreatedEvent(String orderId, Guid instanceId) in D:\workflow_samples\CS\OrderLocalServices\OrderService.cs:line 28
at Microsoft.Samples.Workflow.OrderApplication.Form1.btnOrderCreated_Click(Object sender, EventArgs e) in D:\workflow_samples\CS\OrderApplication\Form1.cs:line 94
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Samples.Workflow.OrderApplication.Program.Main() in D:\workflow_samples\CS\OrderApplication\Program.cs:line 27
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Any help is appreciated.

Error in Beta2
CRasmussen
This is a fairly generic error. It means that you don't currently have an activity subscribing for the event. In a StateMachineWorkflow this normally means you don't have a handle external event activity for the event in the current state or any one of its parents or that the event is coming in while the workflow is in the process of transitioning to the new state. For the second issue you can set the WaitForIdle flag to true on the ExternalDataEventArgs on the one sent with the event, like below:
public void RaiseEvent(ExternalDataEventArgs args)
{
args.WaitForIdle = true;
if (Completed != null)
Completed(null, args);
}
Instead of processing the event imediately the runtime will wait for the workflow to become idle before processing it.