When a Feature gets installed

When a Feature gets installed

Have you ever thought about the Features folder and when a folder will be created for one of you features? Well, I did 🙂

Why is this relevant, anyway? To be able to activate a feature on a given scope, it has to be installed first. That’s why.

ActionResult
stsadm -o addsolutionThe solution is added to the farm. Features are not available
stsadm -o deploysolutionFeature folders are created and the Features are available for activation
stsadm -o installfeatureA feature with ID xyz has already been installed in this farm.  Use the force attribute to explicitly re-install the feature.

Great. After deploying the solution, the feature is automatically installed and can be used. I did expect this, because installing a feature is a rather uncommon task.

Here comes another one. What if you add a feature to an existing – and deployed solution – and perform an upgrade?

ActionResult
stsadm -o upgradesolutionAdds the new feature folder
stsadm -o activatefeatureFeature with Id ‘4520d607-699b-4025-b605-5f988c97b368’ is not installed in this farm, and cannot be added to this scope.

Ups. Did you expect the result? The feature has to be installed first!

Conclusion

If you add a feature to a solution, make sure the features gets installed prior usage! There are two ways

  1. Install the new feature
  2. Retract and Redeploy the solution

Leave a Reply