Question

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?

Was it helpful?

Solution

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).

OTHER TIPS

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 http://msdn.microsoft.com/en-us/library/ff648422.aspx

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

you can order it in visial studio (Package)

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top