Adding workflows to a non-WF project
I have been building up a project that I need to add workflows to, only I didn’t create the project as a workflow project. This means that when I go to add a new item, I get the standard options along with WPF file types and even an option for a WCF service, but no workflow options.
After using WinMerge to compare the project file with a workflow project file, these are the actions I took:
- Add references to System.Workflow.Runtime, System.Workflow.ComponentModel and System.Workflow.Activities.
- Open the project file in notepad and make the following changes
- Add the following to the first Project/ProjectGroup element (it should contain the assembly details) :
Given the name of the ProjectTypeGuids element, I am guessing that the guids should be the same for everyone, but you might have to compare the guids found in a new workflow project to you can create.
- Add the following after the CSharp.targets Import element under the Project element:
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.0\Workflow.Targets" />