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!

Post Comment

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