Search code examples
sharepoint.net-3.5.net-4.0sharepoint-2010workflow-foundation-4

WF 4 and SP 2010 Object Model


I have 2 projects in my solution.

  1. SAMII.Workflow --- .Net 4.0 (Any CPU)
  2. SAMII.Core --- .Net 3.5 (Any CPU)

SAMII.Workflow hosts sequential workflow (WF4) in a Console application.
It also references SAMII.Core which holds the business logic (SharePoint OM via SPMetal).

So when I try to run the solution, I get the following exception:

Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime.

How can I resolve the issue? I cannot downgrade WorkFlow framework to 3.5.


Solution

  • You cannot call SharePoint OM using .net 4.0 But you can call SharePoint WebServices using .net 4.0. So instead using OM, you can use SharePoint Services (REST or WebService).