How to Update properties of sharepoint 2013 feature

I have a feature receiver for BCS model (Farm feature) and I am trying to update the value of a property "SiteUrl" dynamically in this receiver.

Below is the code:

properties.Definition.Properties["SiteUrl"].Value = "Some value";
properties.Feature.Properties.Update();

But I get the following error on the last line:

"Updating the properties of a feature definition is not supported."

Can anyone provide any inputs?


August 31st, 2015 10:11am

Hi,

Thanks for the reply. But I want to update this property dynamically in different environments (test, UAT, prod, etc.). updating this value in feature.xml file would raise the need of changing the value in solution package for every deployment in different environment, which is not an acceptable solution.

UPDATE on above code:

This error occurs only in feature activated event, in deactivating event the property gets updated.

Is there a specific reason behind this?

Free Windows Admin Tool Kit Click here and download it now
September 5th, 2015 4:16am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics