VS Workflow designer not expanding activities

半腔热情 提交于 2019-12-22 11:27:22

问题


I can't figure out why some activities in the WF designer do not expand.

Looking at the sample documentation for the WizardActivityPack activities:

But when I try to open the same file in Visual Studio 2010's WF designer:

If I look at the file using the XML editor I can see all the activities are in the file, but the designer only shows me the one box and I cannot click into or expand it.


回答1:


You have to place the *.design.dll somewhere that visual studio can find it. Like in the %programfiles(x86)%\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies.

VS looks for designers by convention; if the activities are in an assembly called Activity.dll, VS looks for its design classes in an assembly called Activity.Design.dll under VS' codebase (and subdirectories) or (I believe) in the GAC.

This fact is important to know when creating your own activities/designers! The reason behind this is so that your Activity assembly doesn't need to reference the Designers dll; you can deliver the Activity assembly by itself to production while leaving the Designers dll on the design machine.

(If you reference the *.Design.dll from your Activities assembly, or if they exist in the same assembly, this doesn't apply. The recommended pattern is to separate the two and allow VS to load them via convention. For an example of this, see this sample.)




回答2:


add this line new DesignerMetadata().Register(); to WPF presentation



来源:https://stackoverflow.com/questions/8886238/vs-workflow-designer-not-expanding-activities

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