C#中添加对System.Configuration.dll文件的引用

却被编译器提示说: 警告 1 “System.Configuration.ConfigurationSettings.AppSettings”已过时:“This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.AppSettings”
于是转而想找到那个ConfigurationManager类来使用,结果在System.Configuration命名空间下死活找不到ConfigurationManager类, 无奈,求助于网络,才知道原来还要添加对System.Configuration.dll 文件的引用~~
在所要使用ConfigurationManager的程序集中找到引用接口,点击程序集,然后找到引用System.Configuration;

第一步打开解决方案资源管理器
在这里插入图片描述
第二步右击引用节点单机添加引用
在这里插入图片描述
第三步在程序集中找到system.configuration
在这里插入图片描述

发布了64 篇原创文章 · 获赞 15 · 访问量 7268

猜你喜欢

转载自blog.csdn.net/weixin_42263618/article/details/96978164