Developing SharePoint workflows for MOSS 2007 x64 in Visual Studio 2010

There are a couple of postings about this on the web, but none seem to be complete. These are the steps I took to get this to work:

  • Ensure WSS 3.0 SDK is installed. Remember to restart VS 2010 after the installation.
  • Ensure WSPBuilder (with VS2010 integration) is installed.
  • Create a new VS project, of type WSPBuilder Project with Workflow.
  • Once the project is created, in VS right click the project and choose Add, then Sequential Workflow. There will be an error with the Designer.
  • Add the following references to the project. This will fix the Designer, but you will not have the SharePoint Workflows in the toolbox.
    • Microsoft.Office.Workflow.Tasks
    • Microsoft.SharePoint
    • Microsoft.SharePoint.WorkflowActions
    • System.Drawing
    • System.Workflow.Activities
    • System.Workflow.ComponentModel
    • System.Workflow.Runtime
    • System.WorkflowServices
  • In the Solution Explorer in VS, right click the project and choose Unload Project.
  • Right click the project again and choose to Edit the project file.
  • Locate the <ProjectTypeGuids> element underneath the first
    PropertyGroup element, it should look like below:

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

    Replace it with:

    <ProjectTypeGuids>{F8810EC1-6754-47FC-A15F-DFABD2E3FA90};{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

  • Save the project file and reload the project. You should now have the SharePoint Workflows in the toolbox.

Update: After the above steps I was able to create workflows and compile the project. When building the project on our TFS build server however, I got the errors below:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Workflow.VisualBasic.Targets (147): The type or namespace name ‘TargetFrameworkAttribute’ does not exist in the namespace ‘System.Runtime.Versioning’ (are you missing an assembly reference?)

and

c:\Users\[build service acccount]\AppData\Local\Temp\.NETFramework,Version=3.5.AssemblyAttributes.cs (4): The type or namespace name ‘TargetFrameworkAttribute’ does not exist in the namespace ‘System.Runtime.Versioning’ (are you missing an assembly reference?)

I did these additional tweakings to the project file:

  • Delete <Import Project=”$(MSBuildToolsPath)\Workflow.VisualBasic.Targets” /> (as I did not have VB installed)
  • Search for <OldToolsVersion>2.0</OldToolsVersion> and replace the value with 3.5
  • Search for <TargetFrameworkVersion>3.5</TargetFrameworkVersion> and replace the value with v3.5 (add the ‘v’ in front)
  • Search for <ProductVersion>8.0.30703</ProductVersion> and replace the value with 9.0.30729

After the above steps the project was building successfully on the build server.

Advertisement

About Bernado

Based in Australia, I am a freelance SharePoint and Dynamics CRM developer. I love developing innovative solutions that address business and everyday problems. Feel free to contact me if you think I can help you with your SharePoint or CRM implementation.
This entry was posted in SharePoint, Workflow. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s