Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Deploy app to app catalog using CSOM C# in SharePoint online
string webUrl = "";
string username = "";
string password = "password";
SecureString secureString = new SecureString();
var credentials = new SharePointOnlineCredentials(username, secureString);
using (ClientContext ctx = new ClientContext(webUrl))
ctx.Credentials = credentials;
var appManager = new AppManager(ctx);
var apps = appManager.GetAvailable();
var chartsApp = apps.Where(a => a.Title == "Charts 365").FirstOrDefault();
var deployApp = appManager.Deploy(chartsApp, true);
//or deploy the app async
var deployAppAsync = await appManager.DeployAsync(chartsApp, true);

This comment has been minimized.

Copy link

@hassannawaz456 hassannawaz456 commented Jan 24, 2018

what is appmanager directive or assembly reference ??


This comment has been minimized.

Copy link
Owner Author

@gautamdsheth gautamdsheth commented Jun 11, 2018

@hassannawaz45 - i am using the PnP Core library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment