错误4命名空间“System.Configuration”中不存在类型或命名空间名称“ConfigurationManager”。是否缺少程序集引用?

来源:互联网 发布:c语言文件传输 编辑:程序博客网 时间:2024/05/16 18:21

错误 4 命名空间“System.Configuration”中不存在类型或命名空间名称“ConfigurationManager”。是否缺少程序集引用? 

搜索了一下,怎么这么基本的,都不给带进来啊,还要我自己引。

 

 

http://blog.csdn.net/sun04zh3/article/details/6215072

点这里

 

 

关于错误“System.Configuration”中不存在类型或命名空间名称“ConfigurationManager”

分类: asp.net 531人阅读 评论(0)收藏举报

好几次在代码中使用了System.Configuration.ConfigurationSettings.GetConfig方法,但每次使用之后都出现如下提示:



  但奇怪的是每次按系统提示调用System.Configuration.ConfigurationManager.GetSection方法时都出现以下错误:命名空间“System.Configuration”中不存在类型或命名空间名称“ConfigurationManager”(是缺少程序集引用吗?)。以前都尝试失败后就继续使用GetSection方法,今天再次尝试又出错,于是就去查阅了MSDN,关于ConfigurationManager类的说明如下:


关于ConfigurationSettings类的说明如下:

  哈哈,原来ConfigurationSetting属于system.dll程序集中,而ConfigurationManager属于system.configration.dll程序集中,系统默认引入的程序集中不包含system.configration.dll程序集,所以只需引用system.configration.dll程序集就可以了。

 

原创粉丝点击