今天使用的一个配置文件,.config文件
引用时,由于要使用到ConfigurationManager
所以要引用System.Configuration和System.Configuration.dll
开始是简单的引用了
using System.Configuration.dll
dll报错了“命名空间"System.Configuration"不存在类型或命名空间名称"dll"(是缺少程序引用集吗)”
后来打开项目→添加引用,在.Net中找不到System.Configuration.dll,打开文件C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727却找到了System.configuration.dll(注意c为小写)
各位大牛们知道这是怎么回事吗,急。。
引用时,由于要使用到ConfigurationManager
所以要引用System.Configuration和System.Configuration.dll
开始是简单的引用了
using System.Configuration.dll
dll报错了“命名空间"System.Configuration"不存在类型或命名空间名称"dll"(是缺少程序引用集吗)”
后来打开项目→添加引用,在.Net中找不到System.Configuration.dll,打开文件C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727却找到了System.configuration.dll(注意c为小写)
各位大牛们知道这是怎么回事吗,急。。
前者是命名空间的名字,后者是DLL文件名,而实际上都是一个东西,using关键字后必须使用命名空间的名字,不能使用DLL文件名。
using System.Configuration;
using System.Configuration.dll;
后面那个引用不成功