'System.Configuration.ConfigurationSettings.AppSettings' is obsolete

001 picture 001 · Oct 18, 2010 · Viewed 97.8k times · Source

I got the following warning

'System.Configuration.ConfigurationSettings.AppSettings' is obsolete: '"This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings"'

How do you fix it?

Answer

Mike Cheel picture Mike Cheel · Oct 18, 2010

Add a reference to the assembly System.Configuration.

Then at the top (assuming C#) using System.Configuration (Imports System.Configuration in VB.NET).

Use ConfigurationManager.AppSettings["MySetting"] to access the settings!