2015-12-03

Running a Project with Workflow in Provider-Hosted Add-In

While trying to run (F5 in Visual Studio) add-in project of provider-hosted add-in containing workflow I got this error in output window:

Microsoft.SharePoint.WorkflowServices
System.FormatException: RestrictAssociationToId   
 at Microsoft.SharePoint.WorkflowServices.DGWorkflowDeploymentProvider.PublishOrUpdateDefinitions(WorkflowServicesManager proxy, WorkflowDeploymentService deploymentService, Dictionary`2 oldDefinitionIdMap, Dictionary`2 newDefinitionIdMap, Dictionary`2 listIdDictionary)   
 at Microsoft.SharePoint.WorkflowServices.DGWorkflowDeploymentProvider.DeployOrUpgrade(WorkflowScopeIdentifier scopeId, SPWorkflowPart oldParts, SPWorkflowPart newParts, Dictionary`2 listIdDictionary)   
 at Microsoft.SharePoint.WorkflowServices.DGWorkflowDeploymentProvider.Deploy(WorkflowScopeIdentifier scopeId, SPWorkflowPart parts, Dictionary`2 listIdDictionary) StackTrace:
 at Microsoft.Office.Server.Native.dll: (sig=678c0f87-966f-4d99-9c94-b49e788d2672|2|microsoft.office.server.native.pdb, offset=131CE)
 at Microsoft.Office.Server.Native.dll: (offset=21BE5)


Turns out I didn't include target list and history list in the app feature. This caused aforementioned error while trying to deploy workflow during "Activate features" stage. As soon as I included the lists in the feature everything went ok.

1 comment: