I just start working with .NET Framework 4.5 of C#. Am using Windows Form Application. I have do the needed imports such as :
using System.Configuration;
But actually the ConfigurationManager class seems that it is not exits. I have tried to use ConfigurationSettings instead , but Visual Stdio telling me that it is obsolete and replaced by ConfigurationManager !
This is chunk of code related to the problem :
Int32.Parse StartingMonth = int.parse(ConfigurationManager.AppSettings["StartingMonthColumn"]);
So , could you please help me ?
RightClick on project -> Add-> Reference...-> Assemblies-> Framework
Select the System.Configuration (checked)
Should solve the problem.
It is because of reference , I just restarted the project after adding the reference and it is working OK :)
ConfigurationManager is present in System.Configuration namespace but it need System.Configuration assembly in your project.
If you are unable to find the reference here is the correct path
"C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a"
Go to the Add reference and select the browser option and go to the above link. Then you can add the System.Configuration.dll