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

Is is possible to use a custom settings file in SharePoint? Where do I place the .config file, containing the settings - I can only get it to read the default values defined in .settings file.

Update: I am trying to use this solution:

  • Added a custom .settings files.
  • Created a .config file, based on App.config.
  • Referenced the settings file in Web.config using the configSource syntax.

This works great, but I need to figure two things:

  • How I modify Web.config programmatically.
  • How I make SharePoint / Visual Studio copy my custom .config file to the VirtualDirectories folder under Inetpub.
share|improve this question
2  
For further reference, you may also look at this question that describes other ways to store application settings outside of the web.config files. –  SPArchaeologist Dec 19 '11 at 14:34

1 Answer 1

Several techniques can be used for storing application settings but my favorite is using Application Settings Manager that comes with Microsoft Patterns and Practices library for SharePoint. A little bit of learning curve is involved if you have not already used it but it's worth it because it comes with other useful application framework also. Here it is: http://msdn.microsoft.com/en-us/library/ff798488.aspx

I generally do not prefer to store sharepoint application settings for SharePoint in physical locations like custom XML or web.config because of maintenance in multi server scenarios (even though Sharepoint provides classes to deal with web.config files that works in multi server environment).

Edit: Settings stored using Application Setting Manager are stored in content database which means you don't have to put extra efforts when you backup/restore the site somewhere else (as opposed to settings stored in physical files)

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.