我正在使用 C# 2010。由于以下错误,我的网站无法运行:
The name 'WebConfigrationManager' does not exist in the current context.
虽然我包含了 using System.Web.Configuration;,但错误指向的代码行是这样的:
String connectionString = WebConfigrationManager.ConnectionStrings["costr"].ConnectionString;
请您参考如下方法:
这已经存在于system.web.dll中,只需添加命名空间 使用 System.Web.Configuration
