user2740190
user2740190

Reputation:

System.Configuration.ConfigurationManager is not resolved

In my usings I have:

using System.Configuration;

And then in the code I have:

string primary_adrs_key =  ConfigurationManager.AppSettings["PrimaryAddressK"];

But I get the error:

"The name ConfigurationManager does not exist in the current context"

Why? What am I missing?

Upvotes: 6

Views: 2887

Answers (2)

Habib
Habib

Reputation: 223362

You haven't added reference to System.Configuration. Right click on project and click add references.

enter image description here

Upvotes: 3

Sajeetharan
Sajeetharan

Reputation: 222712

Read ConfigurationManager

Add the reference System.Configuration.dll in your project

Upvotes: 11

Related Questions