Instantiate an activity in workflow foundation: VS: OK, build: NOK
I'm starting to work with workflow foundation and I'm doing several tests to understand how it works.
I found here: http://msdn.microsoft.com/en-us/library/ee620806.aspx an example which show a way to开发者_StackOverflow社区 instantiate my workflow in a manner I find great, with the
WorkflowApplication app = new WorkflowApplication(new Sequence1());
So I tried to apply this to my example, but I can't figure out why it doesn't work for my code.
I've create a activity very simple(containing only a sequence of Writeline), and I'm only trying to instantiate it. I'm instantiating it with the same "Name" which is present in the "Name" variable of the "Properties" windows of my activity.
Visual studio seems to see that I can instantiate it, because it doesn't say there is an error and the class is correctly colored. But when I'm trying to compile, I got an exception telling me that my type or namespace "WorkflowTest" cannot be found.
This item is in the same assembly, in the same namepsace.
My Activity has build action "XamlAppdef, do not copy, MSBuild:Compile", like in the sample.
What can I've done wrong?
Thank you very much!
Since you are just getting started with workflow you should check out our beginners guide on MSDN. I especially recommend the Intro to WF4 Hands On Lab.
I found a workaround.
I created the workflow in another project and then everything is working, but I'm pretty sure that there was something that visual studio cannot found
精彩评论