SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a problem with updating the properties of a sharepoint 2010 feature

this is my code :

using (SPSite site = new SPSite("http://vm-pc:2000"))
            foreach (SPFeatureDefinition def in SPFarm.Local.FeatureDefinitions)

                if (def.Scope == SPFeatureScope.WebApplication)
                    if (def.GetTitle(System.Threading.Thread.CurrentThread.CurrentCulture) == "Configure Site Settings")
                        ((SPFeatureProperty)def.Properties[0]).Value = "5";


The problem with:


is it throws an exception:

Updating the properties of a feature definition is not supported.

I can't find a solution to figure out my problem

share|improve this question

You could update the feature definition in the xml if it was deployed via a .wsp and upgrade the feature. This would push the new properties if they were in your feature.xml.

If you open the YOURFEATURENAME.Template.xml file in the Feature node of the feature you want to update in Visual studio, add the new values and then update the feature

<Feature xmlns="">
share|improve this answer
please can you give me more information ? – Mahmoud Samir Nov 28 '12 at 10:38
ok ,that is clear but the problem I want to set this property by code from web part and when i use the update() method of SPFeatureProperty it throw exception : Updating the properties of a feature definition is not supported. – Mahmoud Samir Nov 28 '12 at 11:36
In that case you may have to move the values you want to be storing regarding a feature to the property bag of the web instead of the feature property. As it says, its not supported. – Grooverinthesouth Nov 29 '12 at 12:08

Your Answer


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.