Ran across this one today, and because it’s weird and annoying I thought I’d post a solution. You can thank me later!

The problem goes like this: You’re using Visual Studio 2010 and trying to add a control to an APSX page in an ASP.NET Web Application targeted to .NET 4.0, and some controls don’t show up in IntelliSense. When you type the tag manually, Visual Studio complains that

Element 'ListView' 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.

The application builds fine, and doesn’t throw any errors when you run it.

After a bit of Googling, I found the solution on the ASP.NET forums:

Close Visual Studio, delete the schema cache, and re-open Visual Studio. You can find the schemas under something like:

C:\Users\Pavel\AppData\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas

It is safe to delete all files in this folder.

Delete the contents of that above folder, and all is well.

posted on Wednesday, July 21, 2010 10:52 AM | Filed Under [ Development Microsoft ]

Comments

Gravatar
# Thanks!!! (Grimmygrim @ 9/12/2010 1:49 PM)

Dude, thanks a bunch... was pretty damn tired of looking and trying different things when this worked like a charm, awesome!! :D
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (HC @ 9/17/2010 10:56 PM)

Unfortunately this didn't fix the problem for me! It still can't recognise ListView :-( How annoying!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Gürol @ 11/4/2010 9:23 PM)

Thanks this solutions for me...
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Steve @ 11/13/2010 12:32 AM)

Great fix. Thanks!!!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Jesús @ 12/12/2010 6:05 PM)

Works like a charm! Thank you man =)
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (JP @ 1/4/2011 4:57 AM)

Awesome! This was a real irritation point for me. Thanks!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Brian @ 1/5/2011 7:04 AM)

I can't thank you enough. This was driving me insane and numerous other 'fixes' that I had attempted had failed.

This worked for me. Best regards.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Tom @ 1/26/2011 7:53 AM)

This worked for me. Thanks!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Michal Z @ 2/9/2011 2:06 AM)

Thanks,Thanks,Thanks!!!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Charlie @ 2/27/2011 6:07 AM)

Thank you so much for this, man! This issue is darn annoying. I am so glad you post this resolution!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (ioan @ 3/23/2011 3:18 AM)

Thx a lot for the solution!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Rasmus @ 4/7/2011 8:18 PM)

Such an easy solution to such an annoying issue.
Thank you so much for the post.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Rafael @ 4/8/2011 6:54 AM)

Thank you... now i can sleep again... :)
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Mark @ 4/8/2011 8:38 PM)

AWESOME
thanks!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Bryan L @ 4/9/2011 6:37 PM)

Incredible. Thank you for posting this. Solved my problem too.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (John @ 4/11/2011 2:18 PM)

Exactly what i was looking for. Thanks!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Infidel @ 4/12/2011 11:19 PM)

Seriously dude... you are a legend! Worked perfectly after 7 hours of trying to figure this out. I couldn't understand out why it worked on my primary PC and not my laptop... wow! Glad I did not give in to making major changes when it was working normally elsewhere. Thank ing you later ;)
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (James G @ 4/21/2011 8:00 PM)

Tip my hat to you sir, this has been bugging me for ages
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Eduardo Rocha @ 5/3/2011 6:21 AM)

Thanks a lot, works fine for me!

Regards.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Eduardo Rocha @ 5/3/2011 6:25 AM)

Mannnnnnnnnn... thanks a loooooooooooooooooooooooooooooot!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (David @ 5/19/2011 2:52 AM)

Imagine that - someone posting a solution to a problem that is clear and concise and doesn't require looking at multiple links and trying to figure out the information at each page.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Lokeshkumar @ 5/20/2011 12:24 AM)

it fixed the problem

Thank you very much
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (venkata @ 6/8/2011 9:35 PM)

Thanks a lot.. I was also one of the victims... now it is fine.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Sven @ 6/9/2011 12:28 AM)

This bothered me for a while now and I had tried different things without succes.
Your solution worked perfect! Thanks!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Merin Nakarmi @ 6/21/2011 2:27 AM)

Hi, thank you very much. It helped me too.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Jonathan Schroeder @ 6/24/2011 8:42 AM)

Thanks, I've this issue for the last couple of days, no idea how exactly it happened. I think when I installed the MVC3 pack. In any case your suggestion worked and has since fixed my problem. Great post.

- Jonathan
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Mike @ 7/12/2011 9:50 AM)

Great solution, thanks!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Diego @ 7/22/2011 9:35 AM)

Really helpfull thank a lot!!!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Nathan Hemlock @ 8/10/2011 8:32 PM)

Thank you for this! Works like a charm.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Bubbles @ 8/23/2011 8:16 PM)

My MenuItem is still giving me this error even after doing this. SOS :(
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Farhan Mirza @ 9/1/2011 5:57 PM)

Works for me............................Thanks dude.....you saved my time.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (sample @ 9/23/2011 6:37 AM)

Sadly, it didn't solve my problem (VS2010) with a custom user control (ASCX file). Must be something else! Thanks anyway.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Chris Walsh @ 9/28/2011 11:36 PM)

Thanks for the fix! I wonder if it has anything to do with having to running as Administrator in order to link with IIS?
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (ihsan @ 10/3/2011 12:45 AM)

thanks. it was helpful for me too.

 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Maika @ 10/13/2011 4:24 AM)

Really nice !! It works for me too...thanks
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Joe @ 10/21/2011 4:33 AM)

Okay, that's weird. I went to the directory, selected all of the items and there were exactly 666. Maybe that was the problem. ;-)

Thanks for the tip. Worked a charm!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (M @ 10/25/2011 5:25 AM)

That worked. Thanks!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Tanvir @ 11/24/2011 12:50 AM)

Man you just saved my day as google direct me straight to your page.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Insane @ 11/24/2011 12:58 AM)

Issue not resolved after following above steps. :-(
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Kirk @ 11/29/2011 9:57 AM)

This fixed my issue. Great find!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (hendra @ 12/7/2011 3:26 PM)

I got this error :

Element 'postbacktrigger' 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.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Dev @ 12/18/2011 4:47 AM)

NICEEEEEE
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Nishant Kumar @ 1/1/2012 12:09 AM)

Fixed..........
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Meengla @ 1/16/2012 6:32 PM)

Deleting the schema worked for me. Thanks a bunch!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Jeremy @ 2/2/2012 5:23 AM)

I removed the reflectedschemas, then restored them from the recycle bin and reloaded the site. It had errors on all of the asp.net tags, but then i restored the schemas and merged it with the folder that had replaced it. Now everything is recognized correctly.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Franklin @ 2/15/2012 8:39 AM)

Thank you!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (TekkGuy @ 2/16/2012 6:42 AM)

Unfortunately, this did not resolve my particular issue. Shame, I saw so many comments how it works, I got excited. But alas...I am still stuck with the error. :-(
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Tom @ 2/19/2012 9:54 AM)

Worked for me. Love these types of posts.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (JF @ 3/9/2012 11:15 PM)

thanks !
Destroyed two walls by head kicking before finding your post ;-)
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (chatzi @ 3/20/2012 10:16 PM)

It solved my problem too. Thanks so much :)
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Surya A. Saputra @ 3/27/2012 5:03 AM)

Thanks man, u save my live
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (London Photographer @ 4/9/2012 6:49 AM)

Thanks you. Solved my problem too. I think you'll be getting thanks for this for some time to come.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (wasim @ 4/12/2012 11:00 PM)

awsum dear work like a charm
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (flaugh @ 4/15/2012 2:55 PM)

Great! This really helped me! Thanks!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (shruti @ 5/22/2012 5:01 PM)

thanx a ton....worked great for me..:)
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Anon @ 5/25/2012 4:31 AM)

Could also be caused by conflicting assembly references. Check the top of the page to see if something may not be necessary.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Seyed Ahmad PArkhid @ 6/9/2012 2:38 AM)

nice solution, thanks man!!!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Barbara @ 6/21/2012 11:39 PM)

Thank you soooooooooo much. This was driving me insane.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Lokanath Nayak @ 7/5/2012 6:10 AM)

Thanks Man a lot.. for Ur support....This issue was killing me for last 1 month and Ur remedy worded fine..Thanks Again
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Rameshwar Gutte @ 7/18/2012 6:24 PM)

Thanks...... it worked for me ........ very nice post......
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Kalyan @ 7/20/2012 4:04 AM)

Thanks a lot man...i was having hard time finding solution...Thanks a ton.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (leqid @ 7/21/2012 8:27 AM)

Howdy! Thank you very much for posting. To resolve this issue, I had to...

0. Close Visual Studio 2010.
1. Clear schema cache, as above.
2. Clear ASP.NET temporary files, in <C:\Users\dingus\AppData\Local\Temp\Temporary ASP.NET Files> (Windows 7).
3. Resolve all compilation errors in my solution, ESPECIALLY by commenting out code (in ".aspx.vb" code-behind) that referenced the controls in question.
4. Rebuild solution. Succeeded.
5. One-by-one, uncomment code to offending controls. Compilation errors remained.
6. In the corresponding ".aspx.designer.vb" file, add a declaration for the error-causing control.

For example:

In "SomePage.aspx.vb", this line had an error:

Me.msgMain.Alert("Hello world!")

In "SomePage.aspx.designer.vb", I added:

Protected WithEvents msgMain As Global.MyCompany.MyApp.Web.MessageBox

Note that you must, of course, change "msgMain" to the name of *your* control on the .aspx page. Continuing the example, "msgMain" comes from "SomePage.aspx":

<cc:MessageBoxControl ID="msgMain" runat="server" />

This is in web.config:

<system.web>
<pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false">
<controls>
<add tagPrefix="cc" tagName="MessageBoxControl" src="~/Controls/MessageBox.ascx"/>
</controls>
</pages>
<system.web>

Dang, I should write my own blog about this crud. ;) Hope this helps someone. tgif, leqid
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Dmitriy Lyner @ 8/21/2012 11:45 AM)

Wow...Thank you sooooo sooo much! Great find!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Gilmar @ 8/29/2012 12:34 AM)

Nice !!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Joseph @ 9/1/2012 8:56 AM)

Qapla!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Jane @ 9/5/2012 1:21 PM)

It works. Hooray! Thank you so much.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Manoj Panja @ 9/12/2012 11:36 PM)

Thanks.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Chakra @ 9/23/2012 2:13 PM)

Hi dude,

After a two days of googling i found your solution, and it works fine for me. Thanks a lot for this post sharing. And one more thing i want to share with you guys, in order to find AppData folder in Windows 7 Run -> %AppData%. Then follow the steps ahead above. Bye.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Raj @ 9/29/2012 7:07 AM)

Superb!!!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (dumil @ 10/9/2012 10:08 PM)

It fixed! Thank you very much.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Michelle @ 10/18/2012 6:47 PM)

Saved me, thank you!!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (srini @ 10/23/2012 11:01 PM)

simply awesome.... its working ........
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Taruma @ 11/15/2012 7:09 AM)

Great!!! thank you!!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Ankit Dave @ 12/2/2012 9:00 PM)

Thanks finally it worked.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Mike @ 12/21/2012 4:51 AM)

Thanks a bunch for this one - Was driving me MENTAL!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Suresh @ 1/7/2013 6:14 AM)

Thanks Guy.....Very Helpful for me.....Keet it up.....
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (AD @ 1/11/2013 9:35 PM)

This works great!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Qubex @ 2/3/2013 1:58 AM)

Thanks dude. it was awesome.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Rahul @ 2/22/2013 12:58 AM)

Thnx a ton..My VS detected Updatepanel tag after clearing files frm the mentioned location..
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Steve G @ 3/7/2013 10:16 AM)

FYI: I tried this step but it did not work. I then found the files were also in the following directory. After deleting, it worked!

C:\Users\dummy\AppData\Roaming\Microsoft\VWDExpress\10.0\ReflectedSchemas
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Sooraj @ 4/15/2013 5:39 PM)

Everyone talking about Windows 7 OS. how we can solve this issue in Windows XP
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Martin @ 4/26/2013 4:29 AM)

Thx, works fine for VSExpress for Web 2012.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Chandra Prakash Nagar @ 4/30/2013 4:56 PM)

Thanks a lot...
I have done this.
Nice blog...
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Jide @ 5/9/2013 11:37 PM)

Thanks man. Saved me some good and precious time.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Viraj @ 6/6/2013 8:54 PM)

Thanks a lot man.. Visual Studio detected Update Panel right after clearing files from the mentioned location..
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (soheil @ 6/8/2013 3:44 AM)

solved the problem for me.thank you.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 : XP Solution (Johannes Matlaisane @ 6/17/2013 10:51 AM)

XP Solution:
C:\Documents and Settings\[YourUserAccount]\Application Data\Microsoft\VisualStudio\10.0
Delete all files
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Johannes @ 6/17/2013 10:54 AM)

XP Solution:
C:\Documents and Settings\Matlaisane\Application Data\Microsoft\VisualStudio\10.0
-Delete all files
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (MB @ 9/12/2013 11:35 AM)

Hi , Thanks a lot for your solution. It solved my problem.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Peter @ 11/21/2013 10:51 PM)

thanks dude. lifesaver
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (sagar sawant @ 12/18/2013 3:43 AM)

your this post is really awesome
very very thanks to you
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (TonyG @ 12/21/2013 12:17 PM)

This solution didn't work immediately for me but it probably played a valuable part. I still had the issue after restarting VS. In short I had my UC's on Default.aspx, which has the <%@ Register tags. Just for the very first tag I changed Src="control.ascx" to Src="~/control.ascx". The I did a Clean and Rebuild which finally worked. After that I could remove the ~/. I'm thinking it just needed to get that first rebuild and from there the issue that Really triggered it was cleared out. HTH
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (ga8ful @ 12/28/2013 11:00 AM)

Had to delete files and restore them from the Recycle Bin to get this to work.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Youssef Naimi @ 1/7/2014 9:55 PM)

This works great !
Thanks a lot !
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (thé noir @ 2/3/2014 10:44 PM)

thx for sharing you saved me
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (rhea @ 4/23/2014 9:45 PM)

I am using Visual Studio 2008. Unfortunately, it doesn't have a Reflected Schema folder anywhere in it. What do you think can help me?

best regards,
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Zoe @ 7/2/2014 8:38 PM)

This unfortunately did not work for me :( the problem is still there. I've tried deleting everything, and then restoring the files from the Recycle Bin, and then deleting again, but the warning has not gone away.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Jessi @ 9/2/2014 3:14 AM)

I've changed the tagprefix for Ajaxcontroltoolkit assembly from asp to ajaxtooolkit and it fixed the problem.
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Omika @ 10/28/2014 9:27 PM)

Wow!!! it worked for me :)
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (sergio @ 1/8/2015 2:20 AM)

Muito obrigado, meu caro!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Sasi @ 3/17/2015 7:37 PM)

Thanks bro..........its working............
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Unus @ 5/12/2015 8:03 AM)

it doesn't work for 2013 community edition
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Afshan Khan @ 10/14/2015 1:18 AM)

Thanks a ;ot .The solution worked for me :)
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (Rajan @ 3/9/2016 9:34 PM)

Thanks Bro

Its working perfectly....!
 
Gravatar
# re: “Element 'x' is not a known element” in Visual Studio 2010 (raves @ 4/15/2016 1:34 AM)

worked for me..thanks a lot.

Post Comment

Title *
Name *
Email
Url
Comment *  
Remember me
Please add 6 and 4 and type the answer here:

Search

Site Sections

Recent Posts

Archives

Post Categories

WHS Add-In Tutorial

WHS Blogs

WHS Development