Recently I migrated one of my solutions from .net 3.0 to .net 3.5. For the most part the migration went smoothly, except for an issue with the type provider, and XAML activated workflows that included accompanying .rules files.
I was able to load and work with the workflows in the Visual Studio designer, but they would fail execution at runtime:
line 402
error 1342: Activity 'PersistWasSucessful' validation failed: Can not find the condition "ParticipationSaved". ---> System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: The workflow failed validation..
Typically the "Condition Not Found" error is the result of the .rules file not being loaded at the same time as the workflow. Since I hadn't changed my workflow loading codebase, It seemed an unlikely candidate.
The problem had nothing to do with the Workflow Runtime, but rather a change in how the Rules Files are stored as embedded resources. Thank You "Lutz Roeder's Reflector"!
In .NET 3.0, a XAML WF with a rules file called MyWorkflow in the WorkflowLibrary assembly would have the following resource names:
WorkflowLibrary.MyWorkflow.xoml
WorkflowLibrary.MyWorkflow.rules.rules
*note the duplication of the .rules suffix on the resource name *
in .NET 3.5 the same workflow has the following resource names:
WorkflowLIbrary.MyWorkflow.xoml
MyWorkflow.rules
So 2 things have changed here; the duplication of the .rules suffix (a likely bug that was fixed) is no longer present, and the rules file is saved without the namespace.
After changing my WF hosting logic to extract the rules file using the new naming convention, the rules are once again getting loaded into my runtime and workflows are executing.