The workflow failed validation


Does anyone know why the below would occur if I simpily moved it to a different assembly

Thanks in advance,

Mardo

--

Server Error in '/Mimi' Application.

Answer this question

The workflow failed validation

  • Kevin Gilpin

    Put a try catch block around the call to CreateWorkflow, catch WorkflowValidationFailedException and look at the Errors property. Like below:

    WorkflowInstance instance = null;

    try

    {

    instance = workflowRuntime.CreateWorkflow(Type,Dictionary<string,object>);

    }

    catch (WorkflowValidationFailedException exp)

    {

    StringBuilder errors = new StringBuilder();

    foreach (ValidationError error in exp.Errors)

    {

    errors.AppendLine(error.ToString());

    }

    MessageBox.Show(errors.ToString(), "Validation errors");

    }



  • mblatch

    error 1342: Activity 'WhileWaitingForFile' validation failed: Can not find the condition "Condition1".


    I checked and all the conditions are setup. The .rules file is set to embed into the assembely. I saw a post about not having any classess above the shared class of the workflow, but I dont have anything like that.

    Any help would be appreciated.

    Regards,

    Mardo



  • Alexander Ivanov

    Ok, Here is the deal. I had a workflow in a "workflow project". I moved the classes into another project to try and clean up everything.

    It could not find any conditions.

    What you have to do to fix this is add the line to your .proj file that has new classes from the workflow project..
    ....
    <Project>{9B27C74F-5FCB-4237-BC89-6D17235B0529}</Project>
    <Name>Validator</Name>
    </ProjectReference>
    </ItemGroup>
    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
    <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.0\Workflow.Targets" />
    <PropertyGroup>
    <PreBuildEvent>
    </PreBuildEvent>
    <PostBuildEvent>
    </PostBuildEvent>
    </PropertyGroup>


  • limonada


    One other thing to mention. I had my workflow classes in a workflow project and moved them to a regualar C# project. It compiles fine, and everything comes up okay. Just this funny error. Its almost as if the .rules files ist getting embedded or something.

    Thanks,

    Marty



  • The workflow failed validation