sqlhelper中ConfigurationManager的问题

GetConnSting函数在sqlhelper类中。该类使用到了ConfigurationManager。
sqlhelper在编译的过程中遇到问题,问题原因是ConfigurationManager无法识别。
ConfigurationManager是Configuration集中的类。
而我在命名空间引用了Configuration。
    using System.Configuration;
为何还是会报错呢?
发现是由于虽然在我在命名空间引用了Configuration,但是没有引用它的程序集实体文件。
即,System.Configuration.dll
解决方法:在解决方案与资源管理器中,右键“引用”,引用System.Configuration.dll文件,即可解决该问题。
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章