所以,我有一个类库,我知道它会被网站使用,我需要访问配置设置。我添加了对 System.Configuration 的引用,但在类库中找不到 ConfigurationManager。有几件事,其中一件是当我添加对 System.Configuration 的引用时,它显示为带有小写字母“c”的“System.configuration”,我认为这很奇怪。另一件事,当我访问 System.Configuration 时,最接近 ConfigurationManager 的是“ConfigurationSettings”。我在允许我使用 ConfigurationManager 和此类库的 Web 应用程序中查看了引用的属性,它们都指向完全相同的文件。我需要以其他方式执行此操作吗?
这是我引用它的一个 SS:
最佳答案
它位于System.Configuration 命名空间和程序集System.Configuration。确保转到添加引用中的框架选项卡并选择System.Configuration
关于c# - 在类库中找不到 ConfigurationManager,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29052902/