简体   繁体   English

Visual Studio 2008中缺少工作流项目模板

[英]Missing Workflow project templates in Visual Studio 2008

I cannot add workflow item to my WPF project. 我无法将工作流项添加到我的WPF项目中。

I create a new WPF project and want to add a sequential workflow. 我创建了一个新的WPF项目,并希望添加一个顺序工作流程。 When I do "Add new item" there is no item template to select. 当我执行“添加新项目”时,没有要选择的项目模板。

Any hints? 任何提示?

I don't think you can simply add a workflow to a WPF project. 我认为您不能简单地将工作流添加到WPF项目中。 You need to create a WF project and build your workflow in that, then reference the WF project. 您需要创建一个WF项目并在其中构建工作流,然后引用WF项目。

Although this is not officially supported, you can make pretty much any Visual Studio project support workflows doing steps compiled by Robert L. Bogue in his blog article . 虽然这不是官方支持的,但您可以制作几乎任何Visual Studio项目支持工作流程,这些工作流程执行Robert L. Bogue在他的博客文章中编写的步骤。

Just in case if the original post becomes unavailable, here are his steps (tested on Visual Studio 2008 SP1): 如果原始帖子不可用,以下是他的步骤(在Visual Studio 2008 SP1上测试):

I added the working activity to my core project and… it didn't work. 我将工作活动添加到我的核心项目中......它没有用。 I got this really ugly error when I tried to open the design surface for the activity. 当我试图打开活动的设计表面时,我得到了这个非常难看的错误。 It said in part: 它部分地说:

The service 'System.Workflow.ComponentModel.Design.IIdentifierCreationService' must be installed for this operation to succeed. 必须安装服务“System.Workflow.ComponentModel.Design.IIdentifierCreationService”才能使此操作成功。 Ensure that this service is available. 确保此服务可用。

After I stared at the screen wondering how to figure this out, searched for answers (and came up with nothing), I started looking into the project file and found that there are two necessary pieces to make the workflow designer surface to work. 在我盯着屏幕想知道如何解决这个问题后,搜索了答案(并没有提出任何结果),我开始查看项目文件,发现有两个必要的部分可以使工作流设计器表面起作用。 The first entry that's necessary belongs in the and is: 必要的第一个条目属于和:

{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} {14822709-B5A1-4724-98CA-57A101D1B079}; {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}

Basically, it's saying that it's a workflow project and it's a C# project. 基本上,它说它是一个工作流项目,它是一个C#项目。 If you're using VB, create a new custom workflow activity then open the project file in notepad and you should see a different ProjectTypeGuids node that you can use. 如果您正在使用VB,请创建新的自定义工作流活动,然后在记事本中打开项目文件,您应该看到可以使用的其他ProjectTypeGuids节点。

The second part is an import statement that just goes inside of the root node. 第二部分是一个import语句,它只是在根节点内部。 It is: 它是:

Adding these two entries to your project file makes the workflow extensions work in Visual Studio and can make your custom activity work – even when you started with a standard class library. 将这两个条目添加到项目文件中可使工作流扩展在Visual Studio中工作,并且可以使您的自定义活动工作 - 即使您开始使用标准类库也是如此。

Actually when you select the Workflow on the Project Types. 实际上,当您在项目类型上选择工作流程时。 there is another dropdown on the right side having framework 2.0, framework 3.0, framework 3.5. 在框架2.0,框架3.0,框架3.5的右侧还有另一个下拉列表。

if you select the framework 3.5. 如果你选择框架3.5。 you will more of the project templates you asked for. 您将获得更多您要求的项目模板。

thanks Muthu 谢谢Muthu

Rather create a Workflow Library and access it from your WPF application? 而是创建一个工作流程库并从WPF应用程序访问它?

Check out DinnerNow sample app... thy use it! 看看DinnerNow示例应用程序......你使用它!

  1. Open VS Studio command prompt 打开VS Studio命令提示符
  2. Run the following command: 运行以下命令:

     devenv /installvstemplates 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM