Does anyone know a way to activate a sandbox solution in SharePoint Online without having the site collection features automatically activated?

Background info:

I have done a bit of testing with various methods of solution activation and I was able to confirm that activating user solutions from either the UI or PowerShell will cause the site collection features to be automatically activated. Activating a user solution programmatically via code however does not cause the site collection features to be automatically activated. eg. by using the SPSite.Solutions.Add() method.

I thought I had the answer with the programmatic approach which was working fine in my test console application but when I moved it to my sandbox solution project, it doesn’t work because the SPSite.Solutions property is not available in sandbox solutions (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.solutions). I’ve also had a look at the client object model and it doesn’t look the Solutions property is available there either.

The project I’m currently working on will be eventually deployed to SharePoint Online (multi-tenant) so any farm based solutions are out of the picture.

1 Answer 1


In the feature xml you can specify the following property 'ActivateOnDefault' which allows you to set if you want to activate the feature by default or not.

If you set this property to 'FALSE' your feature should not get activated when your sandbox solution is activated.

You can specify this property in the feature xml as shown below:

<Feature xmlns="http://schemas.microsoft.com/sharepoint/" Title="Some feature" ActivateOnDefault="FALSE" Description="Deploys some stuff" >
        <ElementManifest Location="Consto_PageLayouts\Elements.xml" />

Or using visual studio click on the feature and in the feature properties panel you can set it there enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.