Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 ?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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#

    <ProjectTypeGuids>{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

  • 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” />
share|improve this answer
    
Works like a charm now –  Bart May 11 '11 at 10:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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