Workflow Failed On Start

by Håvard Hebnes 26. June 2009 14:48

Recently I tried to create a custom approval workflow using VS2008 with wspbuilder. I successfully deployed the wsp and added the workflow to a custom list, but when I started the workflow I got an error saying: Failed on Start (retrying)

In the SharePoint logfile I found this error:
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)

After debugging my workflow I noticed that the error occured in a while loop where I used “Declarative Rule Condition”. The solution for this problem was 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 I reloaded the project and redeployed the wsp and everything worked :)

Comments

7/16/2009 1:42:39 AM #

Amazing!  You saved the day for me.

Craig United Kingdom | Reply

8/24/2009 8:08:25 PM #

Thank you.

Steve United States | Reply

9/26/2009 12:54:17 AM #

Gracias ídolo! Ya me estaba volviendo loco.

Javier Argentina | Reply

9/28/2009 6:57:29 PM #

Marvelous! Thankyou muchly

Daniel United Kingdom | Reply

11/9/2009 10:31:35 PM #

Nice Post and good information.

It didn't resolve my problem somehow.

I am getting same error while starting of workflow, FYI: I am not using WSPBuilder, I created workflow using VS 2008 (SharePoint 2007 Sequential workflow template), when I put "While" activity OR “If” activity with "declaration code", it's giving me above error.

I already checked into my project file, I have below highlighted line as per your post.

<Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets" />

It seems that some DLL got corrupt or something else or I am missing some code Frown

If you have any idea related to this, can you please help me to resolve this error?

Thank you!
Sanket

Sanket Shah United States | Reply

3/9/2010 9:28:22 AM #

I still believe Havard Hebnes | Workflow Failed On Start that you should have affiliate links for the products that meet your standards for excellence. Welcome First time jumped here on your site, founde on Yahoo. Thank you!! You have given me much to think about. Koopman Send me news to vickyblack163@gmail.com

Koopman Poland | Reply

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.6.0.0
Theme by Mads Kristensen