VS ASP. C # compiler ScriptManager Bug

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.