Windows Workflow基础活动+迁移到Visual Studio 2010

时间:2011-03-24 11:32:42

标签: visual-studio-2010 .net-4.0 workflow-foundation workflow-foundation-4

我使用VS2008

创建了一个继承自CompositeActivity的自定义worflow活动,如下所示
public class CustomWorkflowActivity : System.Workflow.ComponentModel.CompositeActivity

我能够写下面没有任何问题

<GS0:People365WorkflowActivity x:Class="People365.Workflows.Advance_Loan_1WF"
                           x:Name="Advance_Loan_1"
                           xmlns:GS0="clr-namespace:WorkflowEngine.Engine;assembly=WorkflowEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d2bf1cbcd6bbcd82"
                           xmlns:GS1="clr-namespace:WorkflowEngine.ActivityLibrary;assembly=WorkflowEngine.ActivityLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d2bf1cbcd6bbcd82"
                           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<GS1:People365SequenceActivity x:Name="Activity2" WorkflowTemplateActivityId="a6b6327b-c27f-459e-a933-c3cf66ab711f" IsMandatoryActivity="False"></GS1:People365SequenceActivity>
</GS0:People365WorkflowActivity>

将应用程序迁移到VS2010后,出现以下错误

  • “People365WorkflowActivity”类型不支持直接内容。
  • 类型'WorkflowEngine.Engine.People365WorkflowActivity'没有合适的TypeConverter或内容属性来处理此内容。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:3)

使用下面的文字:

<GS0:People365WorkflowActivity x:Class="People365.Workflows.Advance_Loan_1WF"
  x:Name="Advance_Loan_1" xmlns:GS0="clr-    
  namespace:WorkflowEngine.Engine;assembly=WorkflowEngine,Version=1.0.0.0, 
  Culture=neutral, 
  PublicKeyToken=d2bf1cbcd6bbcd82" xmlns:GS1="clr-    
  namespace:WorkflowEngine.ActivityLibrary;assembly=WorkflowEngine.ActivityLibrary, 
  Version=1.0.0.0, Culture=neutral, PublicKeyToken=d2bf1cbcd6bbcd82"     
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   <GS0:People365WorkflowActivity.Activities>
      <GS1:People365SequenceActivity x:Name="Activity2" 
          WorkflowTemplateActivityId="a6b6327b-c27f-459e-a933-c3cf66ab711f" IsMandatoryActivity="False">
      </GS1:People365SequenceActivity>
   </GS0:People365WorkflowActivity.Activities>
</GS0:People365WorkflowActivity>