Recawo
Recawo

Reputation: 183

Activate sandbox solution in Sharepoint office 365

Well I have tried this so far.

ClientOM.List list = clientContext.Site.GetCatalog((int)ClientOM.ListTemplateType.SolutionCatalog);
        clientContext.Load(list);
        clientContext.ExecuteQuery();

        ClientOM.ListItemCollection listItemColls = list.GetItems(new ClientOM.CamlQuery());
        clientContext.Load(listItemColls, listItem => listItem.Include(item => item.DisplayName, item => item["Status"]).Where(i => i.DisplayName == "Tzunami Office 365 Sandbox Package"));
        clientContext.ExecuteQuery();

Then i read status of sand box solution. It gives status of sandbox solution i.e listItemColls[0]["Status"] is equal to null when wsp file is not activated..

I want to activate that solution if it is not activated. How can i do it??

Upvotes: 3

Views: 1769

Answers (2)

Recawo
Recawo

Reputation: 183

I did it other way.I track the request send to activate the sand box through fiddler. Just replicate same process through code

Upvotes: 1

Ahmed Masud
Ahmed Masud

Reputation: 612

I've spent some time looking into this and I don't believe there is any programmatic access to activate sandbox solutions in SharePoint Online.

You can programmatically upload the solution into the gallery, and you can activate features, but none of the supported APIs (Client OM, Sandbox code, web services) include the facility to activate a solution.

I personally find this a little bit disappointing because it's the one missing step to building complex automated deployments of customisations into SharePoint Online.

The best you could do (and this would be totally unsupported and liable to break at any time in the future) would be to simulate a web browser performing the actions of authenticating into SharePoint Online, opening up the Solutions Gallery and clicking on the appropriate UI elements to activate solutions.

Upvotes: 1

Related Questions