我正在研究C# 2010。由于以下错误,我的网站无法运行:
名称'WebConfigrationManager‘在当前上下文中不存在。
虽然我已经包含了using System.Web.Configuration;,但错误指向的代码行如下:
String connectionString = WebConfigrationManager.ConnectionStrings["costr"].ConnectionString;发布于 2012-01-04 13:00:07
这在system.web.dll中已经存在,只需使用System.Web.Configuration添加命名空间即可。
发布于 2013-09-13 11:42:42
我是唯一一个注意到你拼错了WebConfigurationManager的人吗?
WebConfigrationManager那可能是罪魁祸首。
发布于 2012-01-04 12:56:20
添加System.Configuration引用,然后添加using System.Configuration
https://stackoverflow.com/questions/8727201
复制相似问题