在NAnt中从<solution>转到<exec program = msbuild>

Ang*_*ker 2 .net msbuild nant projects-and-solutions

我已经将我的应用程序从.NET 1.1转换为.NET 3.5,不幸的是NAnt的标签不支持.NET 3.5.所以我试图使用标签直接启动msbuild.

这是我对.NET 1.1的看法:

<solution solutionfile="MyApp.sln" 
        configuration="ServerDebug" outputdir="MyApp\bin\ServerDebug">

             <assemblyfolders>
                   <include name="Dependencies\Libs\bin\ServerDebug"/>
             </assemblyfolders>
</solution>
Run Code Online (Sandbox Code Playgroud)

我把它改成了

<exec program="msbuild">
    <arg value="MyApp.sln /p:Configuration=ServerDebug;OutDir=bin\ServerDebug\" />
</exec>
Run Code Online (Sandbox Code Playgroud)

所以一切都运行正常,除了我无法弄清楚如何复制真正方便的标签,这给编译器一个关于在哪里寻找依赖的提示.

我将什么传递给msbuild来复制功能?

Sco*_*aad 5

我认为可以通过两个选项中的一个来完成.通过使用MSDN上描述的AdditionalLibPathsAssemblySearchPaths.

类似于以下内容:

<exec program="msbuild.exe">
    <arg line="/p:Configuration=ServerDebug"/>
    <arg line="/p:OutDir=bin\ServerDebug\" />
    <arg line="/p:AssemblySearchPaths=Dependencies\Libs\bin\ServerDebug" />
    <arg line="MyApp.sln" />
</exec>
Run Code Online (Sandbox Code Playgroud)