Question

I have a .wsp file uploaded into the Solution Gallery of a site collection created in Office 365. This solution is not activated and I want to activate it programmatically. The below code is an example on how to achieve it for a solution file in an on premise sharepoint site.

SPDocumentLibrary solutionGallery = (SPDocumentLibrary)siteCollection.GetCatalog(SPListTemplateType.SolutionCatalog);
SPFile file = solutionGallery.RootFolder.Files.Add("HelloWorldSolution.wsp", File.ReadAllBytes("HelloWorldSolution.wsp"));
// Activating the solution file 
SPUserSolution solution = siteCollection.Solutions.Add(file.Item.ID);

Is there a sharepoint online(Office 365) equivalent of this, that can be achieved through the client object model in CSOM?

Was it helpful?

Solution

Use this, It has neat explanation. You can use webclient Api to do that job http://blog.symprogress.com/2013/07/upload-wsp-file-to-office365-sp2013-using-webclient/

OTHER TIPS

There is currently nothing in CSOM to accomplish this.

The only way that I expect you could get this to work is to mock the browser. You will need to query the page to get the details on the uploaded .wsp and then submit back to activate it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top