DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report

Tools for Authoring NAnt Build Files

Boyan Kostadinov user avatar by
Boyan Kostadinov
·
Feb. 21, 08 · Interview
Like (0)
Save
Tweet
Share
8.21K Views

Join the DZone community and get the full member experience.

Join For Free

NAnt is a great tool for automating many computer tasks. For a quick introduction, check my previous articles Automating Your Computer Tasks with NAnt and Use NAnt and WinRar to Create a Self Extracting Archive. Authoring NAnt build files can be difficult without a good editor and editing XML is not my favorite thing to do anyway. Having to know all the tags and parameters for each NAnt task, makes it even less desirable. Looking at the current options, you can find several tools for authoring NAnt build files:

  • NAntPad - Commercial -  http://nantpad.com
  • NAntBuilder - Commercial - http://www.nantbuilder.com
  • Editor4NAnt - Free - http://www.download.com/Editor4NAnt/3000-2352_4-10531916.html

While the tools above will do the job, it would be nice if you could edit your build files in Visual Studio and have at least the basic intellisense that the IDE provides. It turns out that editing NAnt build files with VS and having code insight is a pretty easy thing to setup. Here is how it is done:

  1. Install the NAnt schema by copying the file "nant.xsd" form the NAnt distribution to "C:\Program Files\Microsoft Visual Studio 8\Xml\Schemas"
  2. Associate NAnt build files (.build) with the Visual Studio XML editor. This can be done in one of two ways:
    • Create a registry merge file with the following contents and merge it in your registry:
      Windows Registry Editor Version 5.00
      
      [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Editors\{412B8852-4F21-413B-9B47-0C9751D3EBFB}\Extensions]
      "build"=dword:00000029
      
    • Make the association through Visual Studio:
      • Open any Visual Studio solution
      • Add a NAnt build file to it
      • Right click on the .build file and choose "Open With"
      • Select "XML Editor" and click on "Set as Default"
  3. Almost there. The last thing is to add the "xmlns" (namespace) attribute to the "project" tag of your build file. If you have copied the NAnt schema file (nant.xsd) to the right place, adding the "xmlns" attribute should list the NAnt schema as one of the available choices. The end result should look like:
    <project
    	name="testProject"
    	default="buildSetup"
    	basedir="."
    	xmlns="http://nant.sf.net/release/0.85/nant.xsd"
    >
    
  4. And Voila! Start typing some XML and you should see a list of NAnt tasks and attributes.
NAnt Build (game engine)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • What “The Rings of Power” Taught Me About a Career in Tech
  • MongoDB Time Series Benchmark and Review
  • How to Use Buildpacks to Build Java Containers
  • Best Practices for Setting up Monitoring Operations for Your AI Team

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: