I had an old WSPBuilder project and I wanted to add workflow to it. The old project was created with WSPBuilder project template and with .Net Framework 2.0.
For people who are not interested in my strugle with this problem, skip these first 12 steps
For others, these are the steps I had to go through:
- I tried adding WSPBuilders Sequential Workflow Feature workflow directly to the project. It worked nicely.
- After that I got three reference warnings (System.Workflow.Activities, .ComponentModel and .Runtime)
- I had to change target framework from 2.0 to 3.5. (Right click on project -> properties -> Target Framework). After that the references worked.
- I opened the workflow feature to designer mode and was greeted with these two nice messages
- The service ‘System.Workflow.ComponentModel.Compiler.ITypeProvider’ must be installed for this operation to succeed. Ensure that this service is available.
- The service ‘System.Workflow.ComponentModel.Design.IIdentifierCreationService’ must be installed for this operation to succeed. Ensure that this service is available.
- After some googling Binging I found out that I needed to add more project type GUIDs to my *.csproj file.
- Right click on project -> Unload project. Right click on project -> Edit *.csproj
- Change the key <ProjectTypeGuids> to the following line
- <ProjectTypeGuids>{F8810EC1-6754-47FC-A15F-DFABD2E3FA90};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- Right click on project -> Reload project
- Yeah, now I could edit the workflow in designer!
- I drag-and-dropped few tasks to the workflow, tried building it and it was good! I was already very excited to get this thing working.
- Deployed the solution to MOSS. Right click on project -> WSPBuilder -> Build WSP. Right click on project -> WSPBuilder -> Deploy.
- Added workflow to list and created new item. Nothing happened…
- Checked the workflow status and reviewed the logs to find these messages
- From workflow status: Failed on start (retrying)
- From MOSS logs: Engine RunWorkflow: System.Workflow.ComponentModel.Compiler.WorkflowValidationFailedException: The workflow failed validation
- After some more Binging found out that I also have to add some target-files (what every those are…)
- Right click on project -> Unload project. Right click on project -> Edit *.csproj
- Add the following new the key under the existing <Import Project=”$(MSBuildBinPath)\Microsoft.CSharp.targets” />
- <Import Project=”$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets” />
- Right click on project -> Reload project
- Build, deploy and have fun with your workflow!
And here is the same info in a nutshell:
- Change the projects target framework to 3.5
- Unload your project and modify your *.csproj file
- Change the project type GUIDs to this
- ProjectTypeGuids>{F8810EC1-6754-47FC-A15F-DFABD2E3FA90};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- Add this line under the existing <Import Project=”$(MSBuildBinPath)\Microsoft.CSharp.targets” /> key
- <Import Project=”$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets” />
- Reload project, build, deploy and enjoy!


