NaNT .build file Intellisense

If you want to get some limited Intellisense when you’re editing or creating NaNT .build files then you can try the following:

  1. Copy the nant.xsd file from inside your NaNt schema directory.
  2. Paste it into your Visual Studio XML Schemas directory (e.g. C:Program FilesMicrosoft Visual Studio 8XmlSchemas
  3. Restart Visual Studio

When you next load up an existing .build file, Visual Studio should detect it correctly as an XML document. To get the Intellisense to work, you will need to add the XML Namespace to the <project> tag. Start typing the additional attribute ‘xmlns=’ within the opening <project> tag and Visual Studio should offer you the following auto-complete option:

xmlns=http://nant.sf.net/release/0.85/nant.xsd

So your full project tag should look something like :

<project xmlns="http://nant.sf.net/release/0.85/nant.xsd" 
name="Your Build Name" 
default="all" 
basedir=".">

For new .build files, you can select the Schema you want to base your new XML document on by browsing in the Schemas box in the Properties window. You should find xmlSchemas expanded and the nant.xsd entry able to be selected. Tick the nant.xsd box.

6 thoughts on “NaNT .build file Intellisense”

  1. I have a question: How can Visual Studio automatically recognize that the xml schema associated with an existing .build file is nant.xsd?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.