views:

159

answers:

1

I added the following attribute to the assemblyinfo.cs file in the activities project: using System.Workflow.ComponentModel.Serialization; [assembly:XmlnsDefinition("http://Myproject/MyActivitiesLib", "MyActivitiesLib")]

also in my workflow runtime initilize methold, I loaded assemblyreference as following: using (WorkflowRuntime runtime = new WorkflowRuntime()) { TypeProvider provider = new TypeProvider(runtime); provider.AddAssemblyReference("MyActivitiesLib.dll"); runtime.AddService(provider); //start workflow ... }

now I can serialize workflow to xoml file and assembly in workflow xoml file, the XML namespace in match the changes as: xmlns:msdn="http://Myproject/MyActivitiesLib"

however when I try to deserialize the file , I got an loaderror as this:

{"Cannot open a designer for the file because the class within it does not inherit from a class that can be visually designed."}

A: 

Not quite sure what your problem is but I wrote a blog post some time ago about custom activities and pure XOML workflows that might help you. You can find it here.

Also to troubleshoot this I would suggest trying to remove activities and seeing when you can open the XOML file in the designer. That way you can pinpoint the offending activity and that will heft solving the problem.

Maurice
I did as your blog, however it seems some part wrong that workflow designer cannot find the assembly reference for my root activity which defined in MyActivitiesLib, even I added this assembly to typeProvider services .
Allen
Did you put the assembly somewhere VS could load it from like in the GAC? Try using Fuslogvw to debug assembly loading problems.
Maurice