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?
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?
to use
ConfigurationManager.AppSettings[""]
Add Reference Assemblies not useusing System.Configuration;
you must add reference of System.onfiguration in your project then add "Using System.onfiguration;"
next step using like this:
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!I had the same problem in a C# project and I fixed it by writing appSettings instead of AppSettings in the XML file (camelCase expected) in the tag
After all C# is case sensitive
example:
replace
with
also make sure on the top of the case you add:
Just replace
System.Configuration.ConfigurationSettings.AppSettings
with
System.Configuration!System.Configuration.ConfigurationManager.AppSettings
in your code.