If your workflow fails and goes to a status of "Failed on Start (retrying)", and you have declarative rule conditions in your workflow (or RuleSets), it is likely that your workflow cannot be loaded due to a validation error like the one below:
Engine RunWorkflow: System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: The workflow failed validation.
FULL EXCEPTION FROM ULS:
08/31/2009 11:54:56.68 w3wp.exe (0x10DC) 0x047C Windows SharePoint Services Workflow Infrastructure 936l High Engine RunWorkflow: System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: The workflow failed validation. at System.Workflow.Runtime.WorkflowDefinitionDispenser.ValidateDefinition(Activity root, Boolean isNewType, ITypeProvider typeProvider) at System.Workflow.Runtime.WorkflowDefinitionDispenser.LoadRootActivity(Type workflowType, Boolean createDefinition, Boolean initForRuntime) at System.Workflow.Runtime.WorkflowDefinitionDispenser.GetRootActivity(Type workflowType, Boolean createNew, Boolean initForRuntime) at System.Workflow.Runtime.WorkflowRuntime.InitializeExecutor(Guid instanceId, CreationContext context, WorkflowExecutor executor, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.Load(Guid key, CreationContext con... 08/31/2009 11:54:56.68* w3wp.exe (0x10DC) 0x047C Windows SharePoint Services Workflow Infrastructure 936l High ...text, WorkflowInstance workflowInstance) at System.Workflow.Runtime.WorkflowRuntime.GetWorkflowExecutor(Guid instanceId, CreationContext context) at System.Workflow.Runtime.WorkflowRuntime.InternalCreateWorkflow(CreationContext context, Guid instanceId) at System.Workflow.Runtime.WorkflowRuntime.CreateWorkflow(Type workflowType, Dictionary`2 namedArgumentValues, Guid instanceId) at Microsoft.SharePoint.Workflow.SPWinOeHostServices.Send(SPWinOeWorkflow winoeworkflow, SPWorkflowEvent e) at Microsoft.SharePoint.Workflow.SPWinOeEngine.RunWorkflow(Guid trackingId, SPWorkflowHostService host, SPWorkflow workflow, Collection`1 events, TimeSpan timeOut)
The Fix:
As described in http://blog.hhebnes.no/?tag=/workflows, the fix is to:
Edit the Visual Studio project file (using notepad) and add the second line below:
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets" />
Then reload the project and redeploy the wsp and everything will hopefully work. I suspect this might be an issue with WSPBuilder and the project it creates as it doesn't create .NET 3.5 projects by default.
Friday, September 18, 2009
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment