I have 2 projects in my solution.
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.
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).