I've converted my workflow in beta2 from 1.2
When I start the instance, all works properly, also if i raise an events.
But after I persisted and loaded the workflow instance in my asp.net webapp, when i raise an event on this loaded instance, I receive the following exception:
{"Event \"RicercaTesi\" on interface type \"Tirocinio.Rossi.Service.IRicercaTesiService\" for instance id \"d2eb063b-13f6-4c5c-b77e-32fd913a951e\" cannot be delivered."}
The inner exception is:
{"Queue 'Message Properties\r\nInterface Type:Tirocinio.Rossi.Service.IRicercaTesiService\r\nMethod Name:RicercaTesi\r\nCorrelationValues:\r\n' is not enabled."}
This exception comes just when i raise RicercaTesi(null, new RicercaTesiEventArgs(wfid)), after RicercaTesiEventArgs is created
What is the meaning of this inner exception
I think that is something related with the interface that defines RicercaTesi event, so I post also that code
using System;
using System.Workflow.Activities;
namespace Tirocinio.Rossi.Service
{
[Serializable]
public class RicercaTesiEventArgs : ExternalDataEventArgs
{
public RicercaTesiEventArgs(Guid instanceId)
: base(instanceId)
{
}
}
[ExternalDataExchange]
public interface IRicercaTesiService
{
void AggiornamentoStatoTesi(Guid idTesi, string statoTesi, int idStato);
event EventHandler<RicercaTesiEventArgs> RicercaTesi;
}
}

What is the meaning of this exception?
Christian Neuhold
Redarko,
Since the workflow is hosted in ASP.NET and uses the ManualWorkflowSchedulerService, you need to manually run the workflow.
So, if your aspx page looks like:
CreateWorkflow/StartWorkflow
RaiseEvent1
RaiseEvent2
You are seeing the exception because when the event is raised, the workflow had not yet had a chance to run. To pump the workflow queue, you need to do something like this:
CreateWorkflow/StartWorkflow
WorkflowWebRequestContext.Current.WorkflowRuntime.GetService<ManualWorkflowSchedulerService>().RunWorkflow(instance.InstanceId);
RaiseEvent1
WorkflowWebRequestContext
.Current.WorkflowRuntime.GetService<ManualWorkflowSchedulerService>().RunWorkflow(instance.InstanceId);RaiseEvent2
Arjun
Debutant0
Only a little change to your advice... in my asp.net webapp I have to manually run the workflow after each event I raise... so now in my asp.net page I have comething similar to:
CreateWorkflow/StartWorkflow
WorkflowWebRequestContext.Current.WorkflowRuntime.GetService<ManualWorkflowSchedulerService>().RunWorkflow(instance.InstanceId);
RaiseEvent1
WorkflowWebRequestContext.Current.WorkflowRuntime.GetService<ManualWorkflowSchedulerService>().RunWorkflow(instance.InstanceId);
RaiseEvent2
WorkflowWebRequestContext.Current.WorkflowRuntime.GetService<ManualWorkflowSchedulerService>().RunWorkflow(instance.InstanceId);
All seems to work properly: is it ok or this situation could cause some errors in future
I've noticed that the sdk documentation and labs about ASP.NETconcepts are not so numerous. Do you have another source of informations about specific ASP.NET windows workflow development
Thank you again
RyanWilkes
Thank you for your answer Arjun.
Yes, I'm using a StateMachineWorkflow.
I've tryied to set the WaitForIlde flag to true but the workflow wait indefinitely because the worklow was never ilded.
Maybe something is changed from beta 1.2
In beta 1.2 if I have StateA(Eventdriven(eventSinkA, InvokeMethodA, setStateB)), StateB(EventDriven(eventSinkB.....) the workflow was automatically persisted after the setStateB activity, waiting for the event of eventSinkB to be raised.
Now I've tryied to manually persist the workflow with workflowInstance.Unload() but this don't ilde the workflow... so how could I force the workflow to become Ilded
P.S. of course I've correctly added SqlWorkflowPersistenceService in my web.config:
<
add type="System.Workflow.Runtime.Hosting.SqlWorkflowPersistenceService, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionString="Initial Catalog=WorkflowPersistence;Data Source=localhost;Integrated Security=SSPI;" UnloadOnIdle="true" LoadIntervalSeconds="5"/>MikMak
redarko,
This means that the queue you are raising the event to has been programmatically disabled and is currently not available to post messages to. Are you using this with a StateMachineWorkflow If so, ensure that you set the WaitForIdle flag to true, to ensure that the event is only raised when the workflow is idle. Otherwise, you will have to manually do the synchronization from the host.
Arjun
Robert M
Any one out there got a reply
I'd very very interested.