Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve “Validation (): Element ‘x’ is not supported” warning in Visual Studio 2010

I have been getting all of these "Validation (): Element 'x' is not supported" warnings and I can't seem to find a way to get rid of them. Here are two examples:

  • Validation (XHTML 1.0 Transitional): Attribute 'name' is not a valid attribute of element 'ul'.
  • Validation (CSS 2.1): 'border-radius' is not a known CSS property name.

I have searched on the web and all solutions point to removing the following folder:

C:\Users\{username}\AppData\Roaming \Microsoft\VisualStudio\10.0\ReflectedSchemas

Which seems to fix 90% of people's issues, however I don't have that folder anywhere on my computer!

I am using Visual Studio 10 SP1 and this project is an MVC 3 project using Razor and HTML5.

So can anyone else suggest what else might be causing the issue?

Thanks very much.

like image 249
XN16 Avatar asked Jan 16 '23 18:01

XN16


2 Answers

I was encountering the same problem and ALL classic html elements (div, a, p, table..) in every page had green underlines. Intellisense did not give any help with these elements, as if they didn't exist. But all asp controls were fine and valid.

Green underlines

The error was the xmlns="https://www.w3.org/1999/xhtml" in the html tag in my master page. Html 5 does not seem to work well together with the xmlns declaration so I removed it, and voila - everything magically works again!

like image 145
Nurp Avatar answered Apr 27 '23 10:04

Nurp


Those are valid warnings, not a bug or other sort of "issue." The list of valid attributes for <ul> is given in the W3C standards, and it doesn't include name. Meanwhile, border-radius was introduced in CSS 3, which means if you validate against CSS 2.1 it's not going to work.

You can either ignore them or figure out how to suppress those particular warnings in VS2010 (I know how to do that for VC++, but I haven't used VS for HTML before; there should be some section in the Properties window for it).

like image 42
KRyan Avatar answered Apr 27 '23 09:04

KRyan