SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a site defined in onet.xml.

The site has 5 features: some standard, some custom.

One of the standard ones is the team site. On activation of our feature we would link to copy files into the Shared Documents folder.

Problem is that the Team Site feature is running after our feature.

Is there a way to control the order?

share|improve this question
up vote 2 down vote accepted

The order that features are provisioned are: first OOB site collection (site) scoped features are activated in the order specified in onet.xml, then site collection scoped stapled features are activated in random order (beware of race conditions). Then site (web) scoped features are triggered in the order defined in onet.xml, now site scoped stapled features are activated in random order (again beware of race conditions).

share|improve this answer
Thanks, it is the site scoped features in random order that is giving us problems. – Shiraz Bhaiji Jul 7 '10 at 8:38

If I understand your question, you are provisioning a site with a custom site definition (or OOB) and would like to activate some features once the site is provisioned.

You should staple your features to your site definition. Basically created a feature that associates your feature (by Guid) with your site definition (ie. STS#1).

You can control the order in which your features fire using this technique. Ideally you would create a custom site defnition that is more or less empty and then activate all of your features using the stapling functionality of SharePoint.

More here

(FYI - 2010 has a site provisioning event receiver you could look into)

share|improve this answer

you can order it in visial studio (Package)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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