C# ConfigurationManager-如何在.NET 3.5中使用连接字符串?
我在这里看到一篇关于我想做什么的很好的帖子 它说使用ConfigurationManager类。我无法引用ConfigurationManager类 如果查看我正在使用的system.dll(v2.0.50727),则没有ConfigurationManager类 我正在使用VS2008,我的项目将编译为.NET3.5 如果我这样做C# ConfigurationManager-如何在.NET 3.5中使用连接字符串?,c#,.net,configuration,connection-string,C#,.net,Configuration,Connection String,我在这里看到一篇关于我想做什么的很好的帖子 它说使用ConfigurationManager类。我无法引用ConfigurationManager类 如果查看我正在使用的system.dll(v2.0.50727),则没有ConfigurationManager类 我正在使用VS2008,我的项目将编译为.NET3.5 如果我这样做 string test = System.Configuration.ConfigurationManager.AppSettings["test"]; 我收到
string test = System.Configuration.ConfigurationManager.AppSettings["test"];
我收到消息“Error 182命名空间“System.Configuration”中不存在类型或命名空间名称“ConfigurationManager”(是否缺少程序集引用?)
有什么想法吗?配置管理器
是系统配置命名空间的一部分。默认情况下,它不会在项目中引用,因此请从GAC添加对if的引用。您已经引用了“system.configuration.dll”
只需在参考文件夹的VS中单击鼠标右键,然后搜索此dll是否已添加对System.Configuration的参考?对。我以为我有,但我在“System”dll中引用了名称空间“System.Configuration”,如上所述,我在“System”dll中引用了名称空间“System.Configuration”