How to get intellisense to work with NANT files in Visual Studio 2008?

I started with an empty project and tried to customize my build file with

Here is what I have tried so far:

  • Determine which version of NAnt I am using by running NAnt with the -help option .
  • The following line replaces the version of NAnt that I use at the following URL:
    • http://nant.sourceforge.net/release/<my NAnt version> /nant.xsd
    • In this example, let's say 0.90 .
  • Download file: from the above URL to % VS_HOME% \ Common7 \ Packages \ schemas \ xml
    • http://nant.sourceforge.net/release/0.90/nant.xsd
  • Opened my build file in VS (from installing my solution and project)
  • From the menu, click XML-> Schemas ... to add the addition of nant.xsd, which was previously loaded into the IDE.
  • After adding a schema, make sure that there is a green tick next to it in the Use column of the XML Schema window .
  • The following attribute is added to the <project> element of my assembly file:
    • <project ... xmlns = "http://nant.sourceforge.net/release/0.90/nant.xsd">
  • Click OK in the XML Schema window .
  • Finally, I reopened the build file with open with ... XML editor.

, intellisense ( XML, ! -,! [CDATA [, ?)

- , , VS2008?

+3
3

nant.xsd, , (0.85), , VS, :

<project xmlns="http://nant.sf.net/release/0.85/nant.xsd" name="foo">

. , XML, 0.90, ? , sf.net, sourceforge.net.

+3

nantschema. nant, XML-, (nantcontrib, ..).

dev- nant.myprojectname.com( myprojectname , ), xsd . nant.myproject.com , -dev. , - .

nant:

<project
    xmlns="http://www.myprojectname.com/myprojectnamenant"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="www.myprojectname.com/myprojectnamenant http://nant.myprojectname.com/myprojectnamenant.xsd"
    default="go"
    name="myprojectname">

schemaLocation Visual Studio ( - ) http://nant.myprojectname.com/myprojectnamenant.xsd . , VS , Intellisense .

+3

, intellisense NAntContrib. :

1: script nant.sxd, nantxsd.build, NAntContrib:

<project name="nant" default="go">
    <property name="NAntContrib" value="E:\NAnt\nantcontrib-0.91-bin\nantcontrib-0.91\bin" />
    <target name="go">
        <loadtasks assembly="${NAntContrib}\NAnt.Contrib.Tasks.dll" />
        <nantschema output="nant.xsd" target-ns="http://nant.sf.net/release/0.91/nant.xsd"/>
    </target>
</project>

2:. nant.xsd . NAnt, , nanntxsd.build script, :

nant/f:nantxsd.build

3: nant.xsd Visual Studio XML\Schemas. :

"C: \ Program Files (x86) \ Microsoft Visual Studio 10.0 \ Xml \ Schemas \ nant.xsd"

0
source

Source: https://habr.com/ru/post/1795535/


All Articles