转载于https://blog.youkuaiyun.com/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”。

本文介绍了在C#中如何正确地使用ConfigurationManager类来读取应用程序配置文件中的设置,并解决了编译时出现的错误CS0103问题。
3668

被折叠的 条评论
为什么被折叠?



