最近HTML5浪潮已经开始了,VS2010已经有一个扩展支持在HTML5智能提示。你可以从这里下载这个扩展:
http://visualstudiogallery.msdn.microsoft.com/d771cbc8-d60a-40b0-a1d8-f19fc393127d
安装好后,打开VS2010, 通过菜单栏 Tools->Options->Text Editor->HTML->Validation,你可以看到如下图:
选择HTML 5,验证就可以了。然后你们VS2008/2010 编辑器支持HTML5智能提示。 最后效果如下:
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.
- Download this archive and extract the contents to your desktop.
- Copy/Move html_5.xsd to D:Program Files (x86)Microsoft Visual Studio 10.0Common7Packagesschemashtml. The path may vary depending on where you installed VS 2010 or Visual Web Developer 2010.
- From the extracted contents, run the appropriate registry file. In my case, it was VS-2010-x64.reg
- 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.
- Now restart VS 2010 and you should be able to code valid HTML5. Enjoy!