CSC510202. ConfigurationManager should not be used.

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:
  1. AppSettings
  2. 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

SharePoint patterns & practices SharePoint Guidance
SharePoint Secure Store Service
Code Snippet: Get User Credentials Using the Default Secure Store Provider

Last edited Jun 24, 2014 at 11:04 AM by dvd73, version 7

Comments

HappySusan Aug 20, 2013 at 5:37 AM 
Dear,

If this project still need any document writing? I want to contribute in this.