ConfigurationManager Class not exist on .NET 4.5 Framework
I just start working with .NET Framework 4.5 of C#. Am using Windows Form Application. I have do the needed imports such as :
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 ?
- Make sure that you add System.Configuration.dll to the project. If you already added it, try to remove and add it again.
- Put the cursor on ConfigurationManager then press ctrl+., and see what it suggests you.
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
Go to the Add reference and select the browser option and go to the above link. Then you can add the System.Configuration.dll