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

I am creating some features in SharePoint 2010. I need to have some settings for all the features that I intend to keep in a xml file that should get deployed to 14 hive. On feature activation, settings should be read from the xml file. How can I have a common xml file for all my features and how to read it back from 14 hive.

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

You can use properties element in the feature schema. It allows you to store config information in the form of key value pair. Here is a article that describes it usage. Also you can always use resource file (see here), but I guess properties element of feature schema would be better way to do it.

share|improve this answer
    
Well then again it would need re compiling and re deployment if I need to change the values. –  V.B Jun 19 '12 at 7:12
add comment

Sharepoint includes a hierarchical configuration manager that can safely store and retrieve configuration settings. You can use sharepoint property bags to store/retrieve config settings.

SharePoint 2010 does not provide a user interface to read and write these configuration settings at run time. To do this, you can use the property bag editor on CodePlex: codeplex

share|improve this answer
    
+ 1. Sorry I didn't read your reply before posting mine. But I have added some comments –  Falak Mahmood Jun 19 '12 at 7:17
1  
I wouldn't recommend you to use Property key in Feature.xml because every time you change values for Property key, you will have to re-deploy the Feature. I would recommend you using the property bags at SPWeb/SPSite/SPWebApplication Level –  Falak Mahmood Jun 19 '12 at 7:17
    
add comment

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.