Hi all,
we are trying to create SharePoint hosted app with some custom columns, Content types, Lists and Workflows on On-Premise developer farm (configured by Microsoft people, but I am experiencing same issue on my azure SP farm). During development in visual studio everything is working fine. After uploading some early version of app to App-Catalog in same web application where development site is - app cannot be added to sites
Fiddler
We found the way how to make it work by removing this tags from AppManifest.xml after the app package is created by Visual studio. Then app is created and fully functional – WF are started and task, email are assigned.
<AppPrerequisites>
<AppPrerequisite Type="Capability" ID="CDD8F991-B459-4512-8048-03D5A03FF27E" />
</AppPrerequisites>
But now when we were testing update process of APP where there is some change in workflow (even just in description) we get error during update process.
ULS – LOG - ERROR
Exception while executing task f163c62b-69c6-4f5b-94ea-a842a026337d of type Microsoft.SharePoint.Packaging.SPWorkflowDeploymentGroup in job 369742fe-cde7-40e6-bbd8-8b2172bcf223 for instance 78167125-8370-4898-817e-e428e2449678 sitesubscription 00000000-0000-0000-0000-000000000000, rollback = True: Microsoft.Workflow.Client.ScopeNotFoundException: Scope '/SharePoint/default/57496800-a219-4df3-a027-6f1b9d2cc32d/82b81457-8707-420d-984a-c145cd71999c/$Snapshot' was not found. HTTP headers received from the server - ActivityId: 4d758a22-ad61-4c85-9582-7865959e266e. NodeId: CZCHOWSINT1070. Scope: /SharePoint/default/57496800-a219-4df3-a027-6f1b9d2cc32d/82b81457-8707-420d-984a-c145cd71999c/$Snapshot. Client ActivityId : 369742fe-cde7-40e6-bbd8-8b2172bcf223. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.End(IAsyncResult result)
at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content) -
-- End of inner exception stack trace ---
at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)
at Microsoft.Workflow.Client.WorkflowManagementClient.SendRequest[T](HttpWebRequest request, T content)
at Microsoft.Workflow.Client.ScopeManager.GetSnapshot()
at Microsoft.SharePoint.WorkflowServices.DGWorkflowDeploymentProvider.RemoveSnapshot(WorkflowScopeIdentifier scopeId)
at Microsoft.SharePoint.Packaging.SPWorkflowDeploymentGroup.CreateBackupRollback()
at Microsoft.SharePoint.Administration.SPAppTask.CreateBackupOperation()
at Microsoft.SharePoint.Lifecycle.MonitoredTaskExecution.DoTask()
Microsoft.Workflow.Client.ScopeNotFoundException: Scope '/SharePoint/default/57496800-a219-4df3-a027-6f1b9d2cc32d/82b81457-8707-420d-984a-c145cd71999c/$Snapshot' was not found. HTTP headers received from the server - ActivityId: 4d758a22-ad61-4c85-9582-7865959e266e. NodeId: CZCHOWSINT1070. Scope: /SharePoint/default/57496800-a219-4df3-a027-6f1b9d2cc32d/82b81457-8707-420d-984a-c145cd71999c/$Snapshot. Client ActivityId : 369742fe-cde7-40e6-bbd8-8b2172bcf223. ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
at Microsoft.Workflow.Client.HttpGetResponseAsyncResult`1.End(IAsyncResult result)
at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content) -
-- End of inner exception stack trace ---
at Microsoft.Workflow.Client.ClientHelpers.SendRequest[T](HttpWebRequest request, T content)
at Microsoft.Workflow.Client.WorkflowManagementClient.SendRequest[T](HttpWebRequest request, T content)
at Microsoft.Workflow.Client.ScopeManager.GetSnapshot()
at Microsoft.SharePoint.WorkflowServices.DGWorkflowDeploymentProvider.RemoveSnapshot(
Original - AppManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<!--Published:70EDFC97-B41D-43C5-B751-7C00AD999804-->
<!--Created:cb85b80c-f585-40ff-8bfc-12ff4d0e34a9-->
<App xmlns="http://schemas.microsoft.com/sharepoint/2012/app/manifest" Name="UpskillingEffectiveness" ProductID="{B3271FB6-9EBB-4E0A-91A3-584B6B8C5F95}" Version="1.0.0.0" SharePointMinVersion="15.0.0.0">
<Properties>
<Title>Upskilling Effectiveness</Title>
<StartPage>~appWebUrl/Pages/Default.aspx?{StandardTokens}</StartPage>
</Properties>
<AppPrincipal>
<Internal />
</AppPrincipal>
<AppPermissionRequests AllowAppOnlyPolicy="false">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
</AppPermissionRequests>
<AppPrerequisites>
<AppPrerequisite Type="Capability" ID="CDD8F991-B459-4512-8048-03D5A03FF27E" />
</AppPrerequisites>
</App>
Thanks for advice.
Tomas