In this article I will explain how to solve the following warning in Visual Studio when working in C# or VB.Net Application.
Warning: System.Configuration.ConfigurationSettings.AppSettings' is obsolete: '"This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings"'
But when we try to use ConfigurationManager we get the following error.
The type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Configuration' (are you missing an assembly reference?)
The type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Configuration' (are you missing an assembly reference?)
 
 
Cause
This issue generally happens in Windows Forms, Console, Class Library or Windows Service Applications as by default the System.Configuration Assembly is not referenced in these applications.
 
 
Solution
The solution is fairly simple i.e. to add reference of the System.Configuration Assembly to the project in the following way.
1. Right click on the project and click Add Reference option from the Context Menu.
The type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Configuration' (are you missing an assembly reference?)
 
2. From the Add Reference dialog box, click on .Net Tab and look for System.Configuration assembly. Once you find it simply select and click OK.
The type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Configuration' (are you missing an assembly reference?)
 
3. Once the reference is added, it will be shown in the References folder of the Solution Explorer.
The type or namespace name 'ConfigurationManager' does not exist in the namespace 'System.Configuration' (are you missing an assembly reference?)