I use msbuild directly, skipping nAnt. You can call it with a build file as a property and specify the target from the command line. Here is a sample soultion.build file:
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Import the MSBuild Tasks -->
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<ClassLibraryOutputDirectory>bin$(Configuration)</ClassLibraryOutputDirectory>
<ProjectDir>.\</ProjectDir >
<ProjectTestDir>DALTests\</ProjectTestDir >
<ProjectFile>$(ProjectDir)SSN.sln</ProjectFile >
<TestProjectFile>$(ProjectTestDir)DALTests.csproj</TestProjectFile >
</PropertyGroup>
<!-- Build projects by calling the Project files generated by VS -->
<Target Name="Build">
<MSBuild Projects="$(ProjectFile)" />
<MSBuild Projects="$(TestProjectFile)" />
</Target>
<!-- Run Unit tests -->
<Target Name="Test" DependsOnTargets="Build">
<CreateItem Include="DALTests\Bin\Debug\DALTests.exe">
<Output TaskParameter="Include" ItemName="DALTests" />
</CreateItem>
<NUnit Assemblies="@(DALTests)" ToolPath="D:\Program Files\NUnit 2.4.5\bin" ContinueOnError="false" OutputXmlFile="SoultionTestResults.xml" />
</Target>
</Project>
I call this from a batch file like this:
(in the same dir as soultion.build)
C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe Soultion.Build /Target:Build
You will need the MSBuild Community Tasks dll, just google it.