When using the VS (current enterprise latest version of 15.5.5) C # as an ASP. NET project, an error was encountered when switching between console application and class library output type:
Error CS0234: The namespace "System.Web.UI.WebControls" does not exist in the type or namespace name "ScriptManager" (is the assembly reference missing?)
Error CS0234: The namespace "System.Web.UI.WebControls" does not exist in the type or namespace name "UpdatePanel" (is the assembly reference missing?)
The wrong file is located in the "XXX.designer.cs" file, which is the VS auto-generated file.
Online Search This problem exists in large numbers due to the use of a new version of VS Open. The workaround has to modify the Web. config file, have modified the referenced DLL file, and even modify the C disk under a DLL file, feeling is not very reliable.
Create a new ASP. NET project, add ScriptManager, run, no error, it does not appear to be a system or configuration problem. Compare the new and error items to find the following differences in the code:
// Error protected Global :: System.Web.UI.WebControls.ScriptManager ScriptManager1; // correct protected Global:: System.Web.UI.ScriptManager ScriptManager1;
ScriptManager is not even under the WebControls namespace, but other controls are in their space:
protected Global :: System.Web.UI.WebControls.RadioButton radiobutton1; protected Global:: System.Web.UI.WebControls.CheckBox checkbox1;
The following two changes can be made by compiling:
protected Global :: System.Web.UI.ScriptManager ScriptManager1; protected Global:: System.Web.UI.UpdatePanel UpdatePanel1;
Conclusion: It is really not a system or configuration problem, purely a vs bug, other WEB controls are designed under the System.Web.UI.WebControls namespace, except ScriptManager under System.Web.UI, and the VS compiler is mistaken.
X2009 original, reprint need to indicate the source: http://www.cnblogs.com/x2009/p/8387358.html
VS ASP. C # compiler ScriptManager Bug