Cannot create more than one WorkflowRuntime per AppDomain????
I have a webform with a button. On the button click i am calling the workflow and getting the response for the first time. The next time i click i am getting the exception "Cannot create more than one WorkflowRuntime per AppDomain"
That's correct. You're currently basically trying to create a workflow runtime per request.
What you want to do is create your workflow runtime as an application global instance (this is usually done in ASP.NET from your Global.asax) and then use it to create and run workflow instances.
Check out Dino Spositos' article on MSDN Mag, which talks about some of the issues of hosting the workflow runtime in ASP.NET
Tomas Restrepo [MVP]
Tomas Restrepo
Unfortunately some on Dino's article is out of date. In particular the information on the WorkflowWebRequestContext class, which no longer exists. Try the samples found here.
MS Workflow SDE/T - This posting is provided "AS IS" with no warranties, and confers no rights.
Tom Lake
Thanks for the correction Tom, yes, that's right. I was mostly refering to the design comments on the article about keeping a single runtime :)
Tomas Restrepo [MVP]
Tomas Restrepo
This limitation was removed post beta 2. Try upgrading to the most recent CTP.
Thanks, Joel West MSFTE - SDE in WF runtime and hosting
This posting is provided "AS IS" with no warranties, and confers no rights