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

In code utilizing SPWebConfigModification what would the typical reasons be for wanting to modify

Two examples I know of are: Adding a Safe control to the config, and making general changes to the appsettings section.

Are there more, if so, what?

share|improve this question
    
Custom web service endpoint to add ? –  Steve B Jan 18 '12 at 16:18
    
@moderators: isn't this question suitable for a wiki question ? –  Steve B Jan 18 '12 at 16:46
add comment

2 Answers

up vote 1 down vote accepted

For me pretty much the only real need for web.config modifications are:

  • HttpModules
  • HttpHandlers
  • Assembly redirects
  • Custom navigation provider
  • Custom membership provider
  • Namespace loading (i.e. enable web app to use any control in a namespace / assembly without havign to add a page level assembly / namespace directive on every (layout) page

SafeControls should be set by a solution manifest on deployment to a webapp (WSPBuilder and Visual Studio for SP2010 add a SafeControl entry to the solution manifest automatically when needed).

I prefer to store AppSettings in the SPWebApplication's PropertyBag (or in the PropertyBag of say an SPSite.RootWeb, this way, if need be they can be changed using SharePoint Designer or changed using a custom Application Page (in Central Admin).

Furthermore, SP2010 has the SecureStore Service, which you can use to store user names, passwords and connection strings (pretty much any config value).

Edit:

WCF services i usually deploy using MultipleBaseAddressBasicHttpBindingServiceHostFactory (SOAP) or MultipleBaseAddressWebServiceHostFactory (REST). This way SharePoint handles all settings like security endpoint etc.

share|improve this answer
    
I do the same with my WCF bindings... good addition there –  dbobrowski Jan 18 '12 at 20:01
add comment

You can pretty much do any modification that your application needs. The benefit of using that class is that it updates the web.config on all servers in your farm. Most common ones are:

  1. Adding Safe Controls
  2. AppSettings (I prefer to use storing configuration in content database though)
  3. Add Authorized types for workflow actions and conditions
  4. Change the trust level
  5. Add a navigation provider or modify existing provider settings
share|improve this answer
    
6. Third party library requiring custom settings 7. WCF client Endpoint and behavior setup. –  Steve B Jan 18 '12 at 16:46
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.