Description

Avoid using System.Configuration.ConfigurationManager and System.Web.Configuration.WebConfigurationManager classes as well as store any configurations in the web.config files. It requires web.config changes which might affect farm stability, supportability, maintainability and migration. The rule checks follow properties usage:

  • AppSettings
  • ConnectionStrings

Resolution

Depending on the particular scenario, consider the following options to manage configuration:

  • Simple List on the target SPWeb or root web
  • Properties bags within SPWeb, SPSite, SPFarm
  • Secure Store Service.

What’s the difference between the WebConfigurationManager and the ConfigurationManager?

  • WebConfigurationManager is made specifically for ASP.NET applications.
  • WebConfigurationManager provides additional methods to load configuration files applicable to Web applications.
  • ConfigurationManager provides also methods to load configuration files applicable to “.exe” applications.

Links