The feature with Id 'XXX' is not installed in this farm
While working with FeatureDefinition, the following exception may pop up "the feature with Id 'XXX' is not installed in this farm".
We could not reproduce that issue, seems to be farm, service pack or CU-related. Using FeatureDefinition.ForceActivate = true helped.
Use FeatureDefinition.ForceActivate = true