Adding custom intellisense to Visual Studio 2010

To start off you will need an xsd file. An xsd file is a file that just describes the structure of an xml file. Visual studio uses these to add intellisense when you're creating documents like html pages to make it easier to create and also to ensure your documents are valid. Visual Studio comes with a number of these built in and you can also install a few others such as the HTML5 from the visual studio gallery. I won't go into how to create the xsd file here but assuming you have one you can add intellisense and validation to Visual Studio 2010 in just a few simple steps.

The first step is to put the xsd file in a location that VS recognises. If you're running 64 bit Windows then that will be here

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\schemas\

Obviosuly if you're running 32 bit then just remove the (x86). From here you have the choice of html or xml xsd's. Choose the appropriate one for what you want to validate and add the file.

The next step is to add the following registry keys

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Packages\{1B437D20-F8FE-11D2-A6AE-00104BCC7269}\Schemas\Schema 23]  
    "Friendly Name"="Name to appear in visual studio"
    "URI"="http://schemas.microsoft.com/intellisense/yourxsd"
    "File"="xml\yourxsd.xsd"

Here the xsd I've added was for validating an xml file so I put it under the xml folder but just replace that with html if you're using an html xsd. This again assumes you're using 64 bit Windows. If you're running 32 bit Windows then just take out the Wow6432Node from the path of the registry key. This also assumes that you have 22 other schema definition files already defined, adjust Schema 23 to suit your installation.

That's it! Open up Visual Studio, open a file that you want to validate or create and then select your custom validation friendly name from the and Visual Studio is ready and waiting to help you. You didn't really want to type every single letter did you?