我根本无法获取Visual Studio 2005来找到System.Configuration.ConfigurationManager类。下面是代码:无法获得对ConfigurationManager的引用
using System.Configuration;
...
x = ConfigurationSettings.AppSettings["MySetting"]
// The name 'ConfigurationManager' does not exist in the current context
x = System.Configuration.ConfigurationManager.AppSettings["MySetting"]
// The type or namespace name 'ConfigurationManager' does not exist in the
// namespace 'System.Configuration' (are you missing an assembly reference?)
我绝对,积极做在该项目中,以System.Configuration参考,它肯定是在正确的项目。该DLL是2.0.0.0版,运行时版本是2.0.50727 - 与其他所有版本完全相同。我尝试删除引用并重新添加它。奇怪的是,当它显示在项目的参考文件夹中时,它显示为'System.configuration' - 小写'c'。
Visual Studio可以找到System.Configuration.ConfigurationSettings类,除了它已过时的警告外没有任何问题。该项目是一个Web项目,代码位于WebControl的代码隐藏之中。
任何想法发生了什么?
感谢您的建议。事实证明,.NET运行时全部搞砸了,因为它安装的帐户没有足够的权限。完全重新安装一个'上帝'帐户解决了这个问题。很奇怪。 – TallGuy 2009-11-04 00:07:12