I have a sharepoint online provider-hosted (Azure) add-in. It worked properly when debugging and it works properly when I deploy it to my devsite. The problem occurs when I deploy it to any other site - I get the following error :
List 'Documents' does not exist at site with URL 'https://xxxxxxxx.sharepoint.com/sites/xxxxxxx'
The thing is - I checked this multiple times on multiple sites, the List names are the same as on devsite.
Here are some parts of my Elements.xml, Default.aspx and AppManifest.xml, I have literally no idea what could be causing this but my intuition tells me it could be connected to those lines :
<CustomAction
RegistrationType="List"
RegistrationId="{$ListId:Shared Documents;}"
Location="CommandUI.Ribbon"
Sequence="10001"
Title="Invoke 'RibbonApprovalAction' action">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list" Right="FullControl" />
using (var clientContext = spContext.CreateUserClientContextForSPHost())
{
clientContext.Load(clientContext.Web,
web => web.Title,
web => web.CurrentUser,
web => web.Lists);
List doclist = clientContext.Web.Lists.GetByTitle("Documents");
clientContext.ExecuteQuery();
The error occurs at the last line, when I try to execute querry. But like I said, it works perfectly on my devsite. It's as if Shared Documents on devsite were different from Shared Documents on any other site... I don't get it.
clientContext.Web.Lists.GetByTitle("Shared Documents");
? – Gautam Sheth Sep 1 '17 at 5:25