I'm trying to add custom activities to a re-hosted workflow. I am working with the WorkflowDesignerControl sample. I have created a custom activity which is a class that inherits from System.Workflow.ComponentModel.Activity. The custom activity is built as a dll assembly. I have included the custom activity assembly as a reference in the WorkflowDesignerControl assembly dll. I have added the custom assembly to ToollbarItems.txt with the following line:
XSLTActivities.AnXSLTActivity, XSLTActivities
In the WorkflowLoader, Initialize, I am adding the assembly reference to the ITypeProvider service using the following code:
typeProvider.AddAssemblyReference(typeof(XSLTActivities.AnXSLTActivity).Assembly.Location);
The custom activity appears correcly in the Toolbox and I can drag the custom activity onto the workflow. However, when I compile the workflow I get errors in the parsing of the xoml file that the type or namespace of 'XSLTActivites' could not be found (could be missing an assembly reference). Does anyone know how to correct this error I have tried the following:
I added the assembly reference to the CodeCompileUnit in the WorkflowLoad constructor using 2 different constructs:
codeBesideccu.ReferencedAssemblies.Add("XSLTActivites");
and codeBesideccu.ReferencedAssemblies.Add(typeof(XSLTActivities.AnXSLTActivity).Assembly.Location);
In the same constructor, I also added the CodeNamespaceImport to the namespace imports using the following line:
ns.Imports.Add(new CodeNamespaceImport("XSLTActivities"));
This adds 'using XSLTActivities;' to the workflow cs file.
However, neither of these fixes the problem.
Does anyone know how to get the workflow compiler to find the assembly for my custom activity
Software Development for Windows Vista7
|