WebConfigurationManager

roz*_*ze 1 c# asp.net configuration

我正在使用C#2010.由于此错误,我的网站无法运行:

当前上下文中不存在名称"WebConfigrationManager".

虽然我已经包含了using System.Web.Configuration;,但错误指向的代码行是这样的:

String connectionString = WebConfigrationManager.ConnectionStrings["costr"].ConnectionString;
Run Code Online (Sandbox Code Playgroud)

小智 6

这已经存在于system.web.dll中,只需使用System.Web.Configuration添加命名空间


Sof*_*hts 5

我是唯一一个注意到你拼错了WebConfigurationManager的人吗?

WebConfigrationManager
Run Code Online (Sandbox Code Playgroud)

这可能是罪魁祸首.