views:

532

answers:

1

I had a .NET 1.1 project, which I built in NAnt using the following snippet:

<property name="Refs.dir" value="Refs" readonly="false"/>
<property name="OAIDLLs.dir" value="OAI\bin\ServerDebug"/>

<solution 
   solutionfile="OAI\CC.OAI.sln" 
   configuration="ServerDebug" 
   outputdir="${OAIDLLs.dir}">

   <assemblyfolders>
      <include name="${Refs.dir}"/>
   </assemblyfolders>
</solution>

Now someone has converted the project to .NET 2.0, and NAnt can't build it anymore.
It's easy enough to replace the solution tag with

<exec program="msbuild">
    <arg value="OAI\CC.OAI.sln" />
</exec>

but I can't figure out how to pass value in assemblyfolders tag to msbuild. For those who don't know, assemblyfolders tag specifies the folder where the project should look for dependent assemblies.

+2  A: 

One can specify additional properties with a /p switch. The properties that might be of interest here are:

AdditionalLibPaths - Specifies additional folders in which compilers should look for reference assemblies.

AssemblySearchPaths - A list of locations to search during build-time reference assembly resolution. The order in which paths appear in this list is meaningful because paths listed earlier takes precedence over later entries.

To specify additional properties using msbuild with the exec task:

<exec program="msbuild">
    <arg value="OAI\CC.OAI.sln" />
    <arg value="/p:AssemblySearchPaths=c:\path1" />
</exec>

As a side there is an msbuild task that is provided with NAntContrib.

Scott Saad