Wednesday, April 3, 2013

SharePoint 2013: Workflow Error ‘Cannot set unknown member’

I was trying to develop a workflow using Visual Studio 2012 for SharePoint 2013. When I was trying to publish the workflow i was getting the following exception:

Microsoft.Workflow.Client.ActivityValidationException: Workflow XAML failed validation due to the following errors:
Cannot set unknown member 'LookupSPListItem.ItemId'.
HTTP headers received from the server………….

Then after googling i had found the hint in the Microsoft Forum.

 

Solution

Basically you need to re-register the workflow using a Powershell command like below. I think when any Workflow Manager or SharePoint update is installed in the server, these two components get out of sync and re-running the registration will sync both again.

Register-SPWorkflowService -SPSite "SiteURL" -WorkflowHostUri 'WorkflowHostURL'  -Force

Remember to mention Force switch. After the command, restart the Visual Studio or SharePoint Designer and hopefully the issue will be fixed.

4 comments:

  1. I was faced with same problem. On developer server workflow deployed ok. On enterprise server deploing same workflow bring the error:

    System.InvalidOperationException: Microsoft.Workflow.Client.ActivityValidationException: Workflow XAML failed validation due to the following errors: Cannot set unknown member 'LookupSPListItem.ItemId'. HTTP headers received from the server - ActivityId: 304fb4ee-901d-43b8-b7ef-a8bcb220d599. NodeId: SP-WFE01. Scope: /SharePoint/default/0f273f2f-d070-4581-869b-a684dfb4710c/e4b00a05-214e-4b0a-995d-fcd25c56d0c1. Client ActivityId : 3c801e9c-334a-10f4-b8e1-3c6fe1cae7af. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request

    Problem was in difference in versions of SharePoint Client Components. For example after instalation SharePoint Server on enterprise server the version of Microsoft.SharePoint.WorkflowServices.Activities.dll was 15.0.4420. And on developer server after installing Microsof Office Developer Tools for VS 2012 version of Microsoft.SharePoint.WorkflowServices.Activities.dll was 15.0.4481. In this newest version class LookupSPListItem contain the property ItemId.

    After installing SharePoint Server 2013 Client Components SDK (which is a part of Microsoft Office Developer Tools for VS 2012) on enterprise server error was gone!


    ReplyDelete
    Replies
    1. Followed your instructions and got the version '15.0.4615'. I even did a iisreset, however still facing the issue in my Production server which is a x64 machine?

      Please help! Thank you!

      Delete
  2. Александр Свиридов,

    You saved us from falling into the black dark whole... This fixed our dev to qa deployment

    ReplyDelete
  3. got the version '15.0.4615' and still facing the issue. It's kinda urgent. Please help!

    ReplyDelete

Note: Only a member of this blog may post a comment.