I'm building a complex application that is composed by multiples features of different kind.

I want to avoid having all features individually able to be activated from the site admin page.

What my options (Sandboxed solution is not available) ?

I can see three solutions, all consisting in hiding features (HIDDEN=true) :

  • Activate all features from a PS script
  • Create a custom site template, and specify all features in the onet.xml. This will breaks features stappling I fear
  • Create a "Master" feature, visible, that only performs other features activation

What is the best solution ? Is there any other solution I missed ?

ps: sp 2010 enterprise

3 Answers 3


I like the idea of hiding all of your features and having one un-hidden feature that activates the hidden ones.


I do this all the time and have even written my own SPFeatureReceiver class to streamline the creation of such features.

The workhorse of the class though is really just this:

foreach (Guid id in FeatureGuids)
    if (oWeb.Features[id] == null)

Where FeatureGuids is just a list of web scoped feature GUIDs (The guid can be found in the feature manifest file). SPSite also has a features collection that you can do this on.


Of course, one might ask the question why you're breaking it up into many features if they are all dependant on each other and hidden - Why not just deploy them as a single feature? There's no requirement to have different things in different features (Except where they have to be deployed at different levels - farm/webapp/site/web).

But, if you must do it like this, do ensure that the solution/feature dependancies are defined. Scripting or having a 'master' feature would be down to your preference - I'm not aware of any best practise regarding this (although I would probably script the feature activation myself).

  • Marcus, I have to split into several features for two reasons: mainly because of the different scopes of features (site and web), and sometimes because of the <s>awful</s> lookup definitions between several of my list
    – Steve B
    Jun 7, 2012 at 7:19
  • Fair enough. I mention it because I've seen people go crazy in the past (1 feature per artifact).In a project a while ago, the developer had ended up with 30+ features and was wondering why solution deployment was so complicated... Jun 8, 2012 at 3:10
  • Solution deployment should still be easy in this respect. All your features should be grouped into solutions (WSPs) where it makes sense. Most of my projects have 2 or 3. One common WSP that I reuse in all projects and one or two that are project specific. Jun 12, 2012 at 11:37

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.