How to recover from : Workflow Designer encountered problems with your document

。_饼干妹妹 提交于 2019-12-24 01:45:08

问题


As a novice with workflows I create a workflow (in VS2010 workflow designer) with a sequence within which I have a writeline activity. I am experimenting with creating arguments for the workflow so I create 2 arguments in the argument pane w/o doing anything with them at the activity level. (Noteworthy that I dont have a grasp of how to use arguments in the workflow yet). However I save my workflow while the workflow does not show any visible errors( red circles with an excalmation mark). Next time I open the workflow I get the error :

Workflow Designer encountered problems with your document . Please check the document for invalid content, namespaces,references, or reference loops.

And that seems so final because there is no way that I can have access to my original workflow to possibly correct my error (whatever they might be). when I click on the detail down arrow I see this: Could not find member 'a' in type _8684 .

a is one of the two int32 arguments that I had in the workflow but which I never used in any of the activities.

I would appreciate any help. Thanks in advance.


回答1:


It seems you're trying to re-host your Workflow Designer and it's not generating correct XAML for you.

The error Could not find member <mname> in type <tname> commonly occurs if the Workflow Designer instance is directly loading a container activity (sequence, flowchart etc.) instead of using an ActivityBuilder first.

If you're already using an ActivityBuilder then you may have missed giving it the root activity namespace. The correct way to add System.Activities.Presentation.WorkflowDesigner is:

this.workflowDesigner = new WorkflowDesigner();
this.workflowDesigner.Load(new ActivityBuilder { Implementation = new Sequence(),
                                                 Name = "RootNamespace.RootActivity" });

With the Name set properly WF designer would stop using random types (like _8684 in your case) and generate correct XAML on save/serialization. This should help you get rid of the namespace errors.



来源:https://stackoverflow.com/questions/15835934/how-to-recover-from-workflow-designer-encountered-problems-with-your-document

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!