locked
Annoying issue with: Element 'xxxx' is not a known element. RRS feed

  • Question

  • User1998964354 posted

    I am getting hundreds of messages like that: "Element 'xxxx' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing. "

    Very simple to reproduce, just start a new web project and start adding elements to the web page. All this craps starts poping up, no intellisense.

    Friday, April 16, 2010 4:11 PM

Answers

  • User2091356901 posted

    OK, here is the solution that worked for me:

    Instead of this:

    <controls>
    	<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    	<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </controls>


    Set this in web.config:

    <controls>
    	<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </controls>







    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 31, 2010 11:08 AM

All replies

  • User614805505 posted

    Dear gidziu,

    "Element 'xxxx' is not a known element

    The 'xxxx' is Visual Studio build in controls or third party control?

    Saturday, April 17, 2010 9:45 AM
  • User-1666980993 posted

    Please include some actual examples of the errors.  What version of Visual Studio are you using?


    Saturday, April 17, 2010 10:01 AM
  • User1998964354 posted

    The xxxx is a not a control. This is  just a marker I put it. I am getting hundreds iof warnings where xxxx could be 'Content', 'TextBox', 'DropdownList' etc.

    Monday, April 19, 2010 2:55 PM
  • User1998964354 posted

    I am using VS 2010, official release

    Example of an error:

    Warning 3 Element 'TextBox' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.  

    Monday, April 19, 2010 2:57 PM
  • User-1666980993 posted

    This happens with a newly-created, unmodified ASP.NET project?  It sounds like you may have a bad VS.NET install.  The project should build with no errors or warnings immediately after creation.   Those errors usually happen when a needed assembly is not referenced. 


    Monday, April 19, 2010 3:16 PM
  • User-1632605355 posted

    Did you upgrade from VS2008? Did all the assemblies update to the VS2010? 

    Monday, April 19, 2010 3:26 PM
  • User1998964354 posted

    It was a fresh install of 2010 (twice!!). VS 2008 is also installed side by side. 

     

    Tuesday, April 20, 2010 5:22 PM
  • User-1747586707 posted

    Can you try to obtain the callstack to help us investigate the issue?

    1) Create a new website.

    2) Before switching to the design view, Bring up another VS and attach to the first VS instance process, Select Managed code and Native code when attaching. Turn off "Enable Just My Code" on Tools -> Options -> Debugging

    3) Switch to the design view, collect the Stack trace.

    Thanks.

     

    Wednesday, April 21, 2010 4:06 PM
  • User-1447496670 posted

    Can you also email a zipped up projet that contains these errors?

     

    My email is msnow at microsoft dot com

     

    Thanks,

    --Mike 

    Thursday, April 22, 2010 1:32 PM
  • User1261206014 posted

    Has anyone gotten the solution to this yet? I am still having this issue.

    In the web config I have:

    add tagPrefix="wuc" tagName="Login" src="~/UserControls/wucLogin.ascx"

    in the aspx page, this:

    wuc:Login ID="wucLogin" runat="server" />

    Login has a green line still and it shows the same error message. This is a website that was created in VS2008 and is now opened with VS2010 Premium.

     

      Thanks, Kam

    Wednesday, May 26, 2010 5:23 PM
  • User1759134392 posted

    As a workaround, have you tried deleting your schema cache as described in this post? 
    http://forums.asp.net/p/1552731/3811467.aspx#3811467

     

    Bala Chirtsabesan
    Tester, Visual Web Developer Team

     

    Wednesday, May 26, 2010 8:11 PM
  • User1261206014 posted

    Yes, I have tried that and just made things worse. Now the page says that even for <asp:Content the Content is not supported.

     

     

    Thursday, May 27, 2010 9:59 AM
  • User-1747586707 posted

    Hi Kameron,

    Can you try to obtain the callstack with the steps I've mentioned in a post above?

    1) Create a new website.

    2) Before switching to the design view, Bring up another VS and attach to the first VS instance process, Select Managed code and Native code when attaching. Turn off "Enable Just My Code" on Tools -> Options -> Debugging

    3) Switch to the design view, collect the Stack trace.

    Thanks.

    Wednesday, July 7, 2010 5:53 PM
  • User1515272967 posted

    This is not a runtime error.  It is a warning and shows a green line under any <asp:Xxx> controls in the VS10 source code for a .aspx page.  Also intellisense doesn't work on any of the unknown controls.  

    It must be a configuration problem, but the project compiles and runs properly.  I have both VS05 and VS10 installed.  Any ideas?

    Here's a sample warning:

    ---

    Element 'Update Panel' is not a known element.  This can occur if there is a compilation error in the Web site, or the web.config file is missing.


    Warning 1 Element 'Content' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing. C:\Views\shared_ILP\ILP_VOB\ILP_Component\ILPAdmin\secure\ReportCard.aspx 4 6 ILPAdminWarning 1 Element 'Content' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing. C:\Views\shared_ILP\ILP_VOB\ILP_Component\ILPAdmin\secure\ReportCard.aspx 4 6 ILPAdmin---


    Monday, July 19, 2010 2:01 PM
  • User-1747586707 posted

    I've seen other users claim that doing one of the following things would fix the issue:

    1) putting the following line in the webform <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

    2) Re-target your project to use 3.5 framework.

    Please let me know if any of them work for you? Thanks.

    Tuesday, July 20, 2010 6:18 PM
  • User2091356901 posted

    I have also this error.

    I have clean installation of VS2010, no prior versions. I converted my VS2008 project and targeted framework 3.5 and everything compiles without errors, but ajax controls are not recognized and I have problem with update panel triggers.

    Ihave even installed ajax extensions v1.0 for asp.net 2, but no help.

    Did anyone found the solution?


    Saturday, July 31, 2010 7:52 AM
  • User2091356901 posted

    I've seen other users claim that doing one of the following things would fix the issue:

    1) putting the following line in the webform <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

    2) Re-target your project to use 3.5 framework.

    Please let me know if any of them work for you? Thanks.

    I dont use Ajax Control Toolkit, just basic ajax controls like Update Panel. :(

    Saturday, July 31, 2010 7:53 AM
  • User2091356901 posted

    ps. Everything works ok when I open this project on computer with VS2008 and VS2010 installed.

    Saturday, July 31, 2010 8:16 AM
  • User2091356901 posted

    OK, here is the solution that worked for me:

    Instead of this:

    <controls>
    	<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    	<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </controls>


    Set this in web.config:

    <controls>
    	<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </controls>







    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, July 31, 2010 11:08 AM
  • User-1268304087 posted

    I have the same issue and I am not using Ajax.   VS2010, new project, SQL 2008.   All <asp:label / content / textbox etc all underlined with "that quote" which MS doesn't allow you to copy.

     

    I tried copying the above into the wweb config but now I get the first row of the html page (xxx.aspx) blue underlines with Unrecognized config section controls.

     

    This is a nightmare and not really helpful for a new installation and new project.   However I was also getting this on VS2008.

    OPSYS Win7 Pro.

     

    An help gratefully received

    Tuesday, September 28, 2010 3:34 AM
  • User-1268304087 posted

     My God: That line entered in Controls worked!  

    For those idiots like me:

    <System Web>

         <pages>

              <Controls>

    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

    And close them down again e.g. </Controls></Pages></System Web>

    Thank you so much

     

    Tuesday, September 28, 2010 11:05 PM
  • User1280950372 posted

    This is not good. This line should be a standard part of web.config; the developer shouldn't have to be responsible for adding in that line.


    Friday, November 5, 2010 11:58 AM
  • User870613147 posted

    Great! Worked for me too!

    Thursday, January 6, 2011 2:31 AM