Do you use NAnt to build your .NET project (say “yes”)? If so, have you memorized all the tags and attributes defined in the NAnt schema (say “no” even if you have). Do you know that cool IntelliSense thing in Visual Studio.NET (of course you do)? Well, you can have it while editing your NAnt build scripts. Interested (again, say “yes”)? Here’s how to do it:
- Copy the NAnt schema XSD from here (or from the NAnt download available here) to C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas (or to whatever path where VS.NET is installed).
- Open your NAnt build script in Visual Studio.NET.
- Select the XML | Schemas… menu option.
- Click the Add… button and select the NAnt.xsd file that you copied in the first step.
- Add the xmlns=”http://nant.sf.net/release/0.91-alpha2/nant.xsd” attribute to the <project> tag in your NAnt build script, like this:
<project name="project1" xmlns="http://nant.sf.net/release/0.91-alpha2/nant.xsd" default="build" basedir=".">
- Enjoy the IntelliSense goodness!
Now that you’ve added the NAnt schema to Visual Studio.NET, you can have IntelliSense on any NAnt build script simply by adding the xmlns=”http://nant.sf.net/release/0.91-alpha2/nant.xsd” attribute to the root <project> tag.