【发布时间】:2019-03-07 21:54:25
【问题描述】:
我推荐this 为控制台项目添加配置文件。我已成功添加 app.config 但不知道如何使用它。我无法引用System.Configuration.ConfigurationManager.AppSettings;
它会产生以下错误,
“系统配置”中不存在类型名称或命名空间名称“ConfigurationManager”(您是遗漏和程序集参考吗?)”
我右键单击依赖项,但看不到“添加引用”选项。
【问题讨论】:
-
不能引用是什么意思?请提供错误消息和更多信息。
-
更新编译错误
-
您需要在项目中添加对
assembly System.Configuration.dll的引用。见The name 'ConfigurationManager' does not exist in the current context。 -
我在 Mac 上工作,我没有看到“添加引用”选项,但“添加包”可以让我进入 nuget。我是 C# 的新手并使用 mac。
标签: c# macos visual-studio app-config