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

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.

share|improve this question
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

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

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.