How can i check is feature exists? I mean not activated but accessible on current web.

For example i have feature with some id and i need to check is package with this feature is deployed.

Because if i understand this correctly web.Features[id] will return only feature that activated!

For now i have exception like this:

Feature with Id 'a3f59c87-4021-4ec1-a3e1-55022a9e0d86' is not installed in this farm, and cannot be added to this scope.

And i need to check this before.

  • 1
    Can't think of a way other than try activating the feature, if it gets activated without any exception... The feature is available, if not it isn't and then you can again remove the feature programmatically! But why do you need that information? – Arsalan Adam Khatri Nov 26 '12 at 13:34
  • 1
    can you check what web.Site.Features give you? just had an idea – Diptarag Nov 26 '12 at 13:54

I think that you can use script from this post to retrieve list of all installed features on a farm, after this you can check this list and find out does your feature is included in this list or not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.