ConfigurationManager找不到

转载于https://blog.csdn.net/sudaobo/article/details/40340009


private string m_ExcelCmd = ConfigurationManager.AppSettings["ExcelCmd"];

        private string m_MyName = ConfigurationManager.AppSettings["MyName"];
        private string m_TargetFolder = ConfigurationManager.AppSettings["TargetFolder"];

在c#源代码中使用 ConfigurationManager 这个类,虽然引用了using System.Configuration这个包,但是编译时还是报错:错误 CS0103: 当前上下文中不存在名称“ConfigurationManager”。


解决办法是除了在源代码中引用了using System.Configuration,还需在解决方案资源管理器里的“引用”中添加“System.Configuration”。

猜你喜欢

转载自blog.csdn.net/chencaw/article/details/80652408
今日推荐