I have created and packaged a custom application. The app has been uploaded to App catalog. I can add it manually to a SharePoint Online site and it functions without an issue.
Is there a way to add the app to a particular site collection programmatically?
I have the app on my local computer, so I tried:
using (var appStream = System.IO.File.OpenRead(appFilePath))
{
var appInstance = ctx.Web.LoadAndInstallApp(appStream);
ctx.Load(appInstance);
ctx.ExecuteQuery();
Console.WriteLine(appInstance.AppWebFullUrl);
}
I received an error: side-loading is not enabled I found the feature, the feature guid "AE3A1339-61F5-4f8f-81A7-ABD2DA956A7D" and the solution here: http://blogs.msdn.com/b/officeapps/archive/2013/12/10/enable-app-sideloading-in-your-non-developer-site-collection.aspx
However when I am enabling the feature, I receive an error: The feature is not installed on this farm. I have no issues installing other features using the same code.
Question: How to add an app that is already in app catalog to a SharePoint Online site?