I created a workflow project with WSPBuilder and everything worked fine. I then moved the workflow to our main project and added all needed references. However when I try to couple the workflow I always get the message: "Failed on start (retrying)" when it's being executed. In my logs I find following error:

0x14E4 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.MruCache.GetOrGenerateDefinition(Type type, String xomlText, String rulesText, Byte[] md5Codes, Boolean initForRuntime, Boolean& exist) at System.Workflow.Runtime.WorkflowDefinitionDispenser.GetRootActivity(Type workflowType, Boolean createNew, Boolean initForRuntime) at System.Workflow.Runtime.WorkflowRuntime.Initializ...

But the validation should be correct since it worked before ?


Copying over the workflow definition and adding the referenced assemblies isn't enough, since your main project will most likely be of a different type and won't be recognized as a"workflow project". You can solve this by manually editing the project file. To do this:

  • unload the project (right-click on the project node in the solution explorer -> unload project).
  • right-click again to edit the csproj file add following line in the first PropertyGroup element, e.g. under ProjectGuid element. These are the project type Guids for windows C# and Workflow C#


  • find following fragment under the root Project node, usually at the bottom of the csproj file:

    <Import Project=”$(MSBuildBinPath)\Microsoft.CSharp.targets” />

and add following line under it:

<Import Project=”$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets” />
| improve this answer | |
  • Works like a charm now – Bart May 11 '11 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.