2014-09-05 74 views
0

我有问题在Mono框架中运行nant脚本。单声道:使用nant 0.92编译c#

当我用mono-3.5运行nant scipt时出现这个错误。

enter image description here

这是我的恶性素文字。

<target name="compile-libs" depends="prepare" description="Compile the libraries"> 
     <csc target ="library" output="${bin.lib.1}/lib.dll" debug="false"> 
     <sources> 
       <include name="${src.lib.1}/${arg}/*"/> 
     </sources> 
     </csc> 
</target> 

它有什么问题吗?

然后,我改变使用bat文件来编译c#。有用。但是,它只执行第一个命令,然后停止。

echo compile lib1: 
mcs /target:library /out:build\bin-lib-v1.0\lib.dll src-lib-v1.0\lib\%1\foo.cs 
echo compile lib2: 
mcs /target:library /out:build\bin-lib-v2.0\lib.dll src-lib-v2.0\lib\%1\foo.cs 

该bat文件只生成了第一个库。它没有回显“编译lib2”。

感谢先进!

回答

0

如果MCS是一个bat文件(做where mcs检查,如果是mcs.bat),在一个bat文件,当你调用其他蝙蝠一样

mcs /target:library /out:build\bin-lib-v1.0\lib.dll src-lib-v1.0\lib\%1\foo.cs 

当前蝙蝠停止执行,并传递给MCS .BAT不返回回

你应该做的:

call mcs /target:library /out:build\bin-lib-v1.0\lib.dll src-lib-v1.0\lib\%1\foo.cs 

,而不是恶性(如果你喜欢XML),只需使用的MSBuild(单声道xbuild),也有类似的CSC任务,请http://msdn.microsoft.com/en-us/library/ms171479(v=vs.90).aspx

最好(恕我直言)更复杂的场景,FAKE