36

I'm working on a page using <canvas>, which is a HTML5 tag, in Visual Web Developer Express Edition 2008, and the validator in the HTML editor is telling me it's an invalid tag. That's because it's set to validate against XHTML 1.0 Transitional. I'd prefer for it to not do that and tell me what's valid or invalid based on the HTML5 doctype, but I can't find anywhere in the preferences that suggests this would be possible.

Is there a way to tell Visual Studio to validate against HTML5, or add a new spec reference manually? I'd prefer not to have to go in and add tags manually, which appears to be the only option at the moment.

Rahul
  • 12,181
  • 5
  • 43
  • 64
  • 1
    With SP1 Html5 support is there http://blogs.msdn.com/b/webdevtools/archive/2011/01/27/html5-amp-css3-in-visual-studio-2010-sp1.aspx – Tanmoy May 07 '12 at 07:55

5 Answers5

25

It looks like the Visual Web Developer team solved the problem by adding HTML5 support themselves: http://blogs.msdn.com/webdevtools/archive/2009/11/18/html-5-intellisense-and-validation-schema-for-visual-studio-2008-and-visual-web-developer.aspx

You all probably know that new HTML 5 standard is coming. We made a new intellisense schema that you can add to VS 2008 or VWD Express 2008 and get intellisense and validation on HTML 5 elements.

Rahul
  • 12,181
  • 5
  • 43
  • 64
  • 10
    For VS 2010, see http://stackoverflow.com/questions/1682180/will-visual-studio-2010-support-html-5/2923562#2923562 – Oskar Austegard May 27 '10 at 20:11
  • 1
    Rahul also posted an update: http://visualstudiogallery.msdn.microsoft.com/d771cbc8-d60a-40b0-a1d8-f19fc393127d/ – jsalwen Mar 23 '11 at 21:12
  • for VS2005 I had to update the paths and change the registry key from Schema 23 to Schema 21: `HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Packages\{1B437D20-F8FE-11D2-A6AE-00104BCC7269}\Schemas\Schema 21` – Dolphin Dec 08 '11 at 19:37
  • can u please explain what is the procedure i have to follow for html5 to be worked in visual studio 2005 ??? – Viku Aug 01 '12 at 11:45
8

For Visual Studio 2010 you'll want to install the Web Standards Update for Visual Studio 2010 SP1:

It updates the HTML5 intellisense and validation to reflect the latest W3C specifications and fixes some bugs bugs in the current SP1 support for HTML5. Also JavaScript intellisense it updated to reflect many of the new browser capabilities such as Geolocation and DOM storage. Finally, this update adds comprehensive CSS3 intellisense and validation based on the latest specifications from W3C.

For Visual Studio 2008, Microsoft has provided an updated version of the HTML 5 validation schema and intellisense in the Visual Studio Gallery.

HTML 5 Intellisense

The updated schema was posted by Mikhail Arkhipov, the same Microsoft employee who wrote the blog post linked in Rahul's answer.

Community
  • 1
  • 1
Eric Bock
  • 1,732
  • 1
  • 18
  • 22
2

I created a validation schema that you're free to use: http://johndyer.name/post/2009/07/21/HTML5-XHTML5-Validation-Schema-for-Visual-Studio-2008.aspx

John Dyer
  • 1,005
  • 9
  • 15
  • I tried following your directions but I don't have an equivalent hash (obviously) inside the Packages node in the registry. I also don't have one that contains Schemas/Schema 23. Any suggestions? – Rahul Jul 22 '09 at 14:50
  • Oh, I might note that I have Web Developer (Express Edition), not the actual Visual Studio. Not sure if that makes a difference or not. – Rahul Jul 22 '09 at 14:56
1

This is now included in Visual Studio 2010 SP1

jnoreiga
  • 2,156
  • 19
  • 26
0

You can define your own validation standards.

You need to add the file to the folder in VS install, and add to the registry.

This is the description I used (HTML and CSS have a very similar approach): http://blogs.msdn.com/mikhailarkhipov/archive/2007/10/19/how-to-create-custom-css-intellisense-schema-in-visual-studio-2005-and-2008.aspx

Richard
  • 106,783
  • 21
  • 203
  • 265
  • It appears that this requires me to write my own XML Schema for HTML5, is that correct? If so, that's technically a solution, but not one I'm willing to spend the time implementing. That would take forever, and afaik there is no XML Schema for (X)HTML5 at present. – Rahul Jul 07 '09 at 08:43
  • Yes. However starting with a copy of one included with VS would vastly cut the effort. – Richard Jul 07 '09 at 13:05