Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ConfigurationManager not found

I am new to VS 3.5 and I am writing a console app that needs to pull some key values from the app.config file.

I have:

Imports System.Configuration  

and I am trying to reference ConfigurationManager.AppSettings but this generates an error:

Name ConfigurationManager is not declared

What am I missing?

like image 765
DeveloperM Avatar asked Dec 13 '10 16:12

DeveloperM


People also ask

Does ConfigurationManager work in .NET core?

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

How do I add a reference to System configuration ConfigurationManager?

Right click the project and choose add reference, browse "Assemblies" and tick the System. Configuration assembly.

What is ConfigurationManager C#?

ConfigurationManager is the class which helps to read data from configurations. Provides access to configuration files for client applications. Namespace: System.Configuration. To use the ConfigurationManager class, your project must reference the System.


2 Answers

Make sure you have a reference to the assembly System.Configuration.dll

like image 65
Philip Fourie Avatar answered Nov 10 '22 21:11

Philip Fourie


Project -> Add References -> .NET -> select System.Configuration

Project -> Add References -> .NET -> select System.Configuration

like image 24
GorvGoyl Avatar answered Nov 10 '22 23:11

GorvGoyl