Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ConfigurationManager Class not exist on .NET 4.5 Framework

Tags:

c#

.net

.net-4.5

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 ?

like image 843
Hatem Avatar asked Oct 18 '12 04:10

Hatem


People also ask

Can I use ConfigurationManager in .NET core?

ConfigurationManager was added to support ASP.NET Core's new WebApplication model, used for simplifying the ASP.NET Core startup code.

What is the namespace for ConfigurationManager in C#?

ConfigurationManager. AppeSettings["yadayada"];

What is ConfigurationManager configuration?

The ConfigurationManager class enables you to access machine, application, and user configuration information. This class replaces the ConfigurationSettings class, which is deprecated. For web applications, use the WebConfigurationManager class.

What is ConfigurationManager AppSettings?

it is a .net builtin mechanism to define some settings before the application starts, without recompiling. see msdn configurationmanager.


1 Answers

  1. Make sure that you add System.Configuration.dll to the project. If you already added it, try to remove and add it again.
  2. Put the cursor on ConfigurationManager then press ctrl+., and see what it suggests you.
like image 88
Ekk Avatar answered Sep 24 '22 16:09

Ekk