Frequently Asked Questions

rmboggs edited this page Dec 31, 2014 · 6 revisions

Frequently Asked Questions


# Running NAnt ## Permissions ### I am getting the following security exception when I try to run NAnt: ![error msg](

This issue is well documented on Surfjungle's Build & Release Management Blog and other places online. The summary of this issue is that zip files downloaded from the internet are saved as blocked files on Windows machines starting with Vista/7. When you unzip a blocked zip file and try to run any binary program that was extracted, this kind of error can appear. To prevent this error from happening, perform the following steps:

  1. Right-click on the zip file
  2. Select "Properties"
  3. Click the "Unblock" button in the zip file properties window and hit ok
  4. Unzip the zip file and run NAnt as normal

NAnt should now run as normal without the above exception.

# Building NAnt ## Mono ### How can I avoid getting a NullReferenceException when building NAnt on Mono? There are currently some regressions in Mono CVS ([bug #55996]( with regards to AppDomain unloading which cause a NullReferenceException when building NAnt.

Zoltan Varga implemented a workaround for this issue: set the environment variable MONO_NO_UNLOAD to any value before running NAnt:

$ export MONO_NO_UNLOAD=1
$ make clean
$ make
$ mono bin/NAnt.exe clean build

Visual Studio.NET

How can I debug NAnt using Visual Studio.NET?

NAnt cannot be built using VS.NET, as VS.NET (prior to VS.NET 2005) is unable to handle dependencies between projects very well.

However, you can compile NAnt using the NAnt build scripts, and then debug NAnt using VS.NET. To do this, open the NAnt solution file in VS.NET and change the following debugging properties of the NAnt.Console project (using Project -> Properties -> Configuration Properties -> Debugging):

  • Debug Mode: Program
  • Start Application: {select NAnt.exe that you just compiled}

Finally, just run NAnt in VS.NET (using Debug -> Start or just F5), and when VS.NET informs you that there were build errors, and asks whether you still want to continue : select Yes.

# General ## Framework support ### What framework does NAnt target by default? As from NAnt 0.85, NAnt by default targets the framework on which its running. ### How do I change the target framework? NAnt supports three ways for changing the target framework:

From the command line, using the -t[argetframework] argument:

NAnt.exe -t:net-1.0

By changing the default target framework in the NAnt configuration file:

    <platform name="win32" default="net-1.0">

By changing the value of the system property nant.settings.currentframework:

<property name="nant.settings.currentframework" value="net-1.0" />
# Third-party tools ## Visual Studio.NET ### How do I get Visual Studio.NET to recognize a .build file as an XML file? 1. In "Solution Explorer", right-click a .build file and choose "Open With". 2. In the "Open With" dialog, select "HTML/XML Editor" and click the "Set as Default" button.

How do I enable intellisense for .build files?

Copy the schema for your version of NAnt from the schema folder in the NAnt distribution to:

  • Visual Studio .NET 2003
    • The "Common7\Packages\schemas\xml" subdirectory of your Visual Studio.NET installation.
  • Visual Studio 2005
    • The "Xml\Schemas" subdirectory of your Visual Studio 2005 installation.

Return Home

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.