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.
  • 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.
    – SPArcheon
    Commented Dec 19, 2011 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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.