Using NAnt to Create .NET 2.0 Projects

I had a .NET 1.1 project that 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 no longer build it.
Easy to replace solution tag

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

      

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

0


source to share


1 answer


You can specify additional properties using the / p switch. The following properties may be of interest here:

AdditionalLibPaths . Specifies additional folders where compilers should look for referenced assemblies.

AssemblySearchPaths - A list of locations to look for during assembly during reference mount resolution. The order in which the paths appear in this list makes sense because the paths listed above take precedence over later entries.

To specify additional properties using msbuild with exec task:



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

      

As a side, there is a msbuild task provided by NAntContrib .

+2


source







All Articles