private void InnerEnsureFeatureActivation(FeatureDependencyInfo featureDependency, SPFeatureCollection featureCollection) { // If already activated if (featureCollection.Any(sf => sf.DefinitionId == featureDependency.FeatureId)) { if (featureDependency.ForceReactivation) { this.logger.Info( "Disactivating the feature with id '{0}' because the 'ForceReactivation' property was used.", featureDependency.FeatureId); // Deactivate and reactivate feature featureCollection.Remove(featureDependency.FeatureId); featureCollection.Add(featureDependency.FeatureId); } else { this.logger.Warn( @"Feature with id '{0}' is already activated. If you wish to force it's reactivation, please use the 'ForceReactivation' property.", featureDependency.FeatureId); } } else { // Activate feature featureCollection.Add(featureDependency.FeatureId); } }