浙林龙哥

   :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

NAnt intellisense in VS.NET 2003

I know, a zillion people wrote about intellisense in VS.NET for NAnt files already, but just as a reminder for myself I write this blog entry:

  • Create a file NAntGenerateSchema.build with the following NAnt code, modify the SchemaFile property for your installation diretory/version of VS.NET:

    <?xml version="1.0" encoding="utf-8" ?>
    <project name="GenerateNAntSchemaForVS.NET" default="genschema">
        <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>

  • Call this script each time you add some extra tasks dll’s or when you move to a new version of NAnt, because it generates a schema based on the available NAnt tasks.

  • Add you NAnt build file to your VS.NET project (if possible).

  • Open the .build file in VS.NET using File->Open…->File…, and then notice the extra options in the lower right corner of the open file window, select Open With…:
    FileOpenExtraOptions

  • Now select to open this file as selected below, also click Set as Default:
    FileOpenOpenWith

  • Set in the properties window for this file the targetSchema to the NAnt schema:
    NAntSchema

  • Repeat for all your build files. Done.

posted on 2005-08-30 11:37  浙林龙哥  阅读(476)  评论(0编辑  收藏  举报