We have a number of projects that have NAnt build files that we can run from batch files. We went this direction so we can tie the builds to subversion hooks and automate running the tests. However, the output of the NAnt build is significantly different from what is generated by VS when we push F5.
We would like to be able to override the F5 behavior to do the following:
- Run the NAnt Script to build the project and dependencies (the build file is a debug configuration).
- Start the project from the target directory in debug mode so breakpoints can be hit.
Here is a sample of one of our build files:
<?xml version='1.0' ?>
<project name='DWS.WI.Data.Common' default='all' xmlns='http://nant.sf.net/schemas/nant.xsd'>
<property name='dbuild.dir' value='build\debug' />
<property name='nant.settings.currentframework' value='net-2.0' />
<property name='debug' value='true' />
<!-- User targets -->
<target name='all' />
<target name='cleandeb' description='remove previous debug build files'>
<delete dir='${dbuild.dir}' if='${directory::exists(dbuild.dir)}' />
</target>
<target name='init'>
<mkdir dir='build' />
<mkdir dir='build\debug' />
<mkdir dir='build\release' />
</target>
<!-- -->
<target name='debug' depends='cleandeb, init' description='Compiles the projects in debug mode'>
<csc target='library' output='build\debug\${project::get-name()}.dll' rebuild='true' debug='true'>
<sources>
<include name='src\app\DWS.WI.Data.Common\*.cs' />
<include name='src\app\DWS.WI.Data.Common\Properties\AssemblyInfo.cs' />
</sources>
</csc>
<csc target='library' output='build\debug\DWS.WI.Data.Oracle.dll' rebuild='true' debug='true'>
<references>
<include name='build\debug\DWS.WI.Data.Common.dll' />
</references>
<sources>
<include name='src\app\DWS.WI.Data.Oracle\*.cs' />
<include name='src\app\DWS.WI.Data.Oracle\Properties\AssemblyInfo.cs' />
</sources>
</csc>
<csc target='library' output='build\debug\DWS.WI.Data.SQL.dll' rebuild='true' debug='true'>
<references>
<include name='build\debug\DWS.WI.Data.Common.dll' />
<include name='libs\Microsoft.SqlServer.ConnectionInfo.dll' />>
<include name='libs\Microsoft.SqlServer.Smo.dll' />
<include name='libs\Microsoft.SqlServer.SqlEnum.dll' />
</references>
<sources>
<include name='src\app\DWS.WI.Data.SQL\*.cs' />
<include name='src\app\DWS.WI.Data.SQL\Properties\AssemblyInfo.cs' />
</sources>
</csc>
</target>
<target name='test' depends='debug'>
<csc target='library' output='build\debug\DWS.WI.Data.Fake.Test.dll' debug='true'>
<sources>
<include name='src\test\DWS.WI.Data.Fake.Test\*.cs' />
</sources>
<references>
<include name='build\debug\DWS.WI.Data.Common.dll' />
<include name='build\debug\DWS.WI.Data.Fake.dll' />
<include name='tools\nunit\nunit.framework.dll' />
</references>
</csc>
</target>
</project>