欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

C#中提示:当前上下文中不存在名称“ConfigurationManager”

程序员文章站 2022-07-02 12:23:26
场景 想要在程序中获取App.config中设置的内容。 想要通过 ConfigurationManager.AppSettings[key]; 来进行获取,已经添加 using System.Configuration; 但是还是提示“当前上下文中不存在名称ConfigurationManager ......

场景

想要在程序中获取app.config中设置的内容。

想要通过

configurationmanager.appsettings[key];

来进行获取,已经添加

using system.configuration;

但是还是提示“当前上下文中不存在名称configurationmanager”

C#中提示:当前上下文中不存在名称“ConfigurationManager”

 

 

C#中提示:当前上下文中不存在名称“ConfigurationManager”

实现

除了添加using system.configuration;

还要重新添加引用

右击引用--添加--system.configuration

C#中提示:当前上下文中不存在名称“ConfigurationManager”