R – workflow xoml file cannot deserialized after mapping XML namespace to a CLR namespace

networkflowworkflow-foundation

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

Best Answer

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.

Related Topic