Raihan Iqbal
Life is codetastic!

HTML5 Support In Visual Studio 2010

I was trying to play around with HTML5 assuming that VS 2010 had shipped with HTML5 support but to my dismay it was not the case. Bummer! So I did a bit of homework and came up with an easy workaround. If you try googling for html5 visual studio 2010, the first link that you will see is HTML 5 Intellisense for Visual Studio 2010 and 2008. But unfortunately, the patch provided over there doesn’t seem to work. (DO I HAVE TO DO EVERYTHING!!)

So here’s how I got it to work.

  1. Download this archive and extract the contents to your desktop.
  2. Copy/Move html_5.xsd to D:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\schemas\html. The path may vary depending on where you installed VS 2010 or Visual Web Developer 2010. vs2010folder
  3. From the extracted contents, run the appropriate registry file. In my case, it was VS-2010-x64.reg
  4. Now fire up Visual Studio 2010 (or VWD) and navigate to Tools > Options > Text Editor HTML > Validation. On the right panel, select HTML 5 as the Target. vs2010ValOption
  5. Now restart VS 2010 and you should be able to code valid HTML5. Enjoy! vs2010html5demo
Share

Posted in .net, Tools, visual studio | 29,246 views | 36 Comments

Tags: , ,

36 Responses to “HTML5 Support In Visual Studio 2010”

  1. Jason Clark says:

    Excellent info, but you might want to indicate that your VS2010 is installed on the D: drive, and most people would have it on the C:. Hopefully, most developers could figure that out, but I’ve met some that couldn’t. ;)

    Thanks!

  2. Shuaib Rameh says:

    I don’t know why MS and VS team is always behind!!!
    This was very helpful!!!

    Thanks

  3. [...] HTML5 Support In Visual Studio 2010 – Raihan Iqbal looks at the support for HTML5 in Visual Studio, showing how you can get IDE support and validation by moving an XSD for HTML5 into the correct location in your VS install. [...]

  4. Sniffer says:

    Hi Raihan

    Nice post. I’ve had to much the same thing. My main problem is that the HTMLTextWriter doesn’t contain HTML5 tags yet.

    If anyone has created HTMLTextWriter that includes HTML5 tags I’d be eager to try it, so that I can get rid of redundant ‘s!

    Cheers
    Sniffer

  5. Sniffer says:

    That should say div’s in the last sentence, but your commenting system has stripped out the HTML tag!

  6. eric says:

    couldn’t have done without you!

  7. livejwl says:

    You saved me at least 2 hours of rooting around. Thanks. Cheers!

  8. [...] Por defecto Visual Studio 2010 no incorpora una validación para HTML5, hasta el momento la única solución para esto que me ha funcionado la encontré en el Blog de Raihan Iqbal. [...]

  9. Thanks, Great fix and article.. Really useful

  10. Matt says:

    Awesome! This worked great for me (running VS 2010 on Windows 7 64-bit.) Thanks!

  11. [...] Por defecto Visual Studio 2010 no incorpora una validación para HTML5, hasta el momento la única solución para esto que me ha funcionado la encontré en el Blog de Raihan Iqbal. [...]

  12. Talley says:

    You Rock! Thanks Men!

  13. Deon says:

    Brilliant stuff! Thanks for this. It was exactly what I was looking for. Thanks and keep up the good work.

  14. dovi says:

    Thank you it’s great post.

  15. Zach Hodge says:

    Hey thanks! That helped a lot! :)

  16. clklachu says:

    Good post! Will the intellisence be working for javascript APIs also?

  17. MJ says:

    HTML5 is not finished, so BETA releases maybe have this included ;) Either way, thanks, great work!

  18. Thanks for posting – I was looking for this archive.

    HTML5-validation is not yet without errors, however. For example, it keeps complaining that I write a -tag without the type=”text/javascript” attribute (wich is not required, as per W3C).

    However, a step in the right direction.

  19. Apparently the SCRIPT-tag itself is filtered out of the previous comment. Understandable ;-)

  20. Madhu Sudhan says:

    Thanks, your article helped

  21. thanx bru.. it work like a charm… LEGEND

  22. Ashish says:

    Hey niceone!…its work perfect! thankx! :D
    same thing happen with CSS3 so i changed its location.

    * * * * * 5/5

  23. CC says:

    How do i know which one is the *.reg file? How did u run it?

  24. Ash Clarke says:

    There is one flaw in this XSD as it still marks type in script tags as a required attribute.

    To fix this, open up the XSD file in your IDE and go to line 581.

    Look for:

    This is part of the:

    Remove the use=”required” and save. Restart Visual Studio if you have it open.

    The HTML 5 default type for script elements is Javascript.

  25. Ash Clarke says:

    Look for: [ xsd:attribute name=type vs:readonly=true use=required]
    This is part of: [ xsd:element name=script ]

  26. Hi, thank you so much for providing this nice article. I don’t know why Microsoft always sucks in the web. It ‘s always behind others.
    Anyway, I also started a new series on CSS3. A good article is CSS Multi-Column Module. Have a look at it buddy.
    Thanks

  27. kunal says:

    Great post !!!

  28. Binod Singh says:

    Thanks for the support.

  29. Omar says:

    Thank you very much Raihan Iqbal

  30. ashok says:

    thanks you so much for raihan iqbal
    would not have been possible with out you

  31. Rishi Tapsee says:

    Nice post.
    Saved me a lot of time.

  32. mvl says:

    Good post! However I found that my version VS2010 already had html5.xsd loaded. I only needed to change the text editor portion to use HTML5. But without your post I wouldn’t have known how to know that VS2010 was ready for html5! Thanks!

  33. Richard says:

    Does anybody about HTML5 tags in the HtmlTextWriter or have an alternative solution for this?

Leave a Reply