I made an Activity Library project. Next, I created a few Workflows in the project, mostly as demonstrations of Input and Output arguments. I see those as reusable components (Activities) in the toolbox, and have used several in some FlowChart Activities. This works fine in a compiled manner. However, when loading and executing the Workflow from XAML, it fails when it comes to the reference to the Activity from within my project.
What needs to be done in order to re-use Activities from the same project when loading and executing Workflows from XAML?
I suspect that your problem lies in the fact that when you create activities the xmlns:local propery doesn't include the assembly name, only the namespace name. This means that when you load a XAML file, the runtime assumes that the namespace is found in the currently executing assembly. This is an incorrect assumption when you are referencing an activity library from an application.
You have two options to fix the problem.
1) You can manually append ";assembly=MyActivityLibrary" to the xmlns:local property (at the top of you XAML file). This is simple to do but if you ever modify the XAML in Visual Studio then you will have to remember to redo your change every time.
2) When you call XamlServices.Load you can pass a second parameter of type XamlXmlReaderSettings and specify the LocalAssembly property to be your activity library assembly. This would be the more stable approach to take. Then no manual editing of the XAML file is required when you