Solved! - The service 'System.Workflow.ComponentModel. Compiler.ITypeProvider' must be installed for this operation to succeed.

Posted by | Filed under , , ,

I'm working on a SharePoint project where several componenets (Workflow, List Definitions, Content Types, etc.) are tightly related to the same functionality. To reduce the risk of components breaking because of an out-of-sequence or missing dependency, and just to make things easier, I wanted to throw everything together in the same project. I discovered something interesting about Workflows in the process, however.

Namely, if you try to add a Workflow to a typical project, you'll get an error in the Workflow designer saying:

     "The service 'System.Workflow.ComponentModel.Compiler.ITypeProvider' must be installed for this operation to succeed."

This happens if you added references to the proper assemblies (System.Workflow.Activities, System.Workflow.ComponentModel, System.Workflow.Runtime and microsoft.sharepoint.WorkflowActions)!

Odd, but luckily there are solutions. One is to write a bunch of code to build the support that the Workflow Designer needs, but I was looking for something even simpler. What I discovered, is that you can add support for Workflows to your project (the .csproj or .vbproj file) by cracking it open in notepad and adding some "ProductTypeGuids" to the project XML. Just add both of the GUIDs featured in the ProjectTypeGuids element below (or add the element if it's not there), and you should be good to go!

<PropertyGroup>
    ...
    <AssemblyName>MyCompany.Technnology</AssemblyName>
    <ProjectTypeGuids>{14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
    ...
  </PropertyGroup>

 I'm curious to see if you can add these GUIDs to many types of projects to enable Workflow support (and further curious about if there are any consequences apart from designer support),

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments