Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Specifically what are the do's and dont's for installing, activating, deactivating and uninstalling a feature. What are the problem areas of working with features and how do you handle.

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

some good practices are:

  • use feature activation dependencies to control multiple hidden features activations with single master feature
  • clean up web parts on deactivating for web parts added by feature activation

some bad practices are:

  • rely on feature activation order using dependencies
  • clean up data structures (lists/sites) on feature deactivation

some problem areas are:

  • mix features of different scope in a same solution package
  • plan for cross-scope feature dependencies
share|improve this answer
add comment

The best advice I've received on the topic was use the "Boy Scout Method" where you take out whatever you bring in. For example, when your feature is deactivated, it shouldn't leave traces of what it deployed when it was originally activated.

Depending on what you're deploying with the feature, this gets tricky. For example, if it's a content-type or list definition, you won't be able to deactivate the feature if there are any instances of it on the site. Test your feature deactivation in your development environment.

The Feature Upgrading functionality in SharePoint 2010 is useful for versioning changes to your features. Inevitably, the requirements for your feature will change and you'll need to make some changes to it. Chris O'Brien wrote this series on the topic.

Weigh the benefits of declarative / schema based feature definitions vs. using C# and Feature Event handlers. If it's a simple list instance, creating site columns and content types may not be necessary, using C# and Feature Event Handlers could save time and reduce the amount of overhead added to the site for something simple.

share|improve this answer
add comment

Your Answer

 
discard

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.