views:

2847

answers:

5

I cannot add workflow item to my WPF project.

I create a new WPF project and want to add a sequential workflow. When I do "Add new item" there is no item template to select.

Any hints?

+1  A: 

Rather create a Workflow Library and access it from your WPF application?

Check out DinnerNow sample app... thy use it!

rudigrobler
Well, this sounds like a workaround. But I'm not happy with that.
FantaMango77
+3  A: 

I don't think you can simply add a workflow to a WPF project. You need to create a WF project and build your workflow in that, then reference the WF project.

Robert S.
There just is no reason to have the workflow in a seperate project.
FantaMango77
+1  A: 

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.

Just in case if the original post becomes unavailable, here are his steps (tested on 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. 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}

Basically, it’s saying that it’s a workflow project and it’s a C# project. 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.

The second part is an import statement that just goes inside of the root node. 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.

This was the answer for me!
Jon
A: 

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.

if you select the framework 3.5. you will more of the project templates you asked for.

thanks Muthu

A: 

1) Open VS Studio command prompt 2) run the following command:-

devenv /installvstemplates

Nitin

Nitin Mohnani