Wednesday, July 18, 2007

Our next chapter in the buildserver series.  This time we will show you how you can make your NAnt buildscripts in VS 2005 with intellisense.

If you want to create/change your NAnt build scripts you can use either just notepad or any other third party tool.
But you can also use VS2005.  And would it be easy if you also have intellisense then? Well this is possible. You have to do a few steps for this :

  • Close all open VS instances
  • Copy the NAntXSD to c:\Program Files\Microsoft Visual Studio 8\Xml\Schemas. 
  • Run regedt32
  • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Editors\{412B8852-4F21-413B-9B47-0C9751D3EBFB}\Extensions
  • Click on the right pane and select Add > New > DWord
  • Give it the name build and value 29 (hexadecimal NOT decimal).

Now you can start VS2005, open a NAnt build file and there you have intellisense.

Just one remark : If you open your .Build files, use the “open with” option and select “HTML/XML” editor.  If your build script is open, you have to do one important thing so that the intellisense will work.  Normally you shouldn’t have to do it, but it seems that for me and a few other people I know this extra action must be taken.

  • After your build script is open
  • Go to the XML menu
  • Choose create schema

The XSD will be generated for your build script and from now on you can use intellisense in your NAnt build files.

I've included a zipfile with the NAnt XSD and the reg file so everything will be ease for installation.

NAnt Intellisense.zip (17,16 KB)

Txs to Rob Richardson and Clint Stotesbery for the NAnt xsd.


Overview Buildserver chapters on my blog :

Chapter 1 : Introduction
Chapter 2 : CruiseControl.Net
Chapter 3 : Projects
Chapter 4 : Project Structure
Chapter 5 : NAnt and all our buildscripts
Chapter 6 : Buildscript generation Part 1
Chapter 7 : Buildscript generation Part 2
Chapter 8 : NAnt intellisense in VS2005

7/18/2007 1:11:43 PM (Romance Standard Time, UTC+01:00)  #     |