Reza on blogging [MVP]

THIS BLOG HAS MOVED TO: http://blogs.devhorizon.com/reza

Subscriptions

<November 2008>
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

News



toronto.sharepoint.camp


Navigation

Post Categories

Other Bloggers

Personal Links

VS.NET Intellisense for .build files in NAnt

If you have ever worked with NAnt , you probably know that there is an xsd for .build files that provides intellisense in VS.NET 2003. After you add a task dll ( In my case NAnt.SharePoint.Task.dll) or install a newer version of NAnt , there are some manual steps required to make VS recognizes the new schema. Instead of the manual process, you can get NAnt itself to update/generate its schema for the internal use of VS.NET 2003 by creating a build file and calling the command line as described below:

1) Create UpdateCreateSchema.build file with the following NAnt snippet and save the file in for example c:\nantGen folder :

 xml version="1.0" encoding="utf-8" ?>
<project name="
UpdateCreateSchema" default="genschema">
     
might be different in your installation-->

    <property name="SchemaFile" value="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml\NAnt.xsd"/>
    <
target name="genschema">
        <
nantschema output="${SchemaFile}" target-ns="http://nant.sf.net/schemas/nant.xsd"/>
    target>
project>
   

2) Assuming Nant has been properly added to Path variable, open a command prompt and change directory to c:\nantGen . Call the following command line:

 nant file: UpdateCreateSchema.build

3) Now that you have deployed the latest version of NAnt.xsd file to the C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml folder , you must go through all of your build files in your project and

a.Make VS.NET recognize your .build file as an XML file (If already done, skip this step then ): 

In "Solution Explorer", right-click a .build file and choose "Open With". In the "Open With" dialog, select "HTML/XML Editor" and click the "Set as Default" button. Enable intellisense for each .build file.

b.When file is opened by the "HTML/XML Editor" , in the properties window , set the targetSchema to the newly updated/generated Nant.xsd

4) Boom. You'll get intellisense. Enjoy!

posted on Friday, September 22, 2006 3:10 PM by admin

Powered by Community Server, by Telligent Systems