简体   繁体   中英

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?

Read ConfigurationManager

Add the reference System.Configuration.dll in your project

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

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM