views:

38

answers:

2

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?

A: 

as its a warning i dont think it matters unless you have turned off a treat warnings as errors setting

add a reference to System.Configuration

all you have to do is to update to the latest code so where you used ConfigurationSettings.AppSettings[""] change to ConfigurationManager.AppSettings[""]

and this should work

PaulStack
ConfigurationManager - does not exist, where is it?
K001
add a reference to system.Configuration and then it will work - ill update my answer for this
PaulStack
+3  A: 

Add a reference to 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!

Mike Cheel