我正在尝试将nant 0.90与visual Studio2008,.net 3.5项目一起使用。team city正在调用nant脚本。这里没有太复杂的东西。
<?xml version="1.0"?>
<project name="IPSA System" default="build" basedir=".">
<property name="nant.settings.currentframework" value="net-3.5"/>
<msbuild project="FS.IPSA.WebAdmin\FS.IPSA.WebAdmin.csproj">
<arg value="/property:TeamOutPath=Release\FS.IPSA.WebAdmin" />
<property name="TeamOutPath" value="Release\FS.IPSA.WebAdmin" />
</msbuild>
</project>我遇到的问题是nant坚持调用.net 2.0编译器,而不是3.5编译器。我认为将nant.settings.currentframework值放入脚本是为了强制框架版本。情况似乎并非如此。可能导致问题的其他原因是什么?
发布于 2010-09-06 17:09:03
最后,结果证明nant并没有引起问题,它调用的是正确版本的msbuild,但是msbuild调用的是错误的csc.exe版本。我没有追踪到它为什么要这么做,但它看起来是msbuild,而不是nant。
发布于 2010-08-19 21:58:13
也许msbuild任务无法构建vs.net 2008解决方案(例如,调用了错误的msbuild.exe版本)。
使用下面这样的代码怎么样:
<!-- msbuild from .net 2.0 is unable to build vs.net 2008 solutions. Let's try to find .net 3.5 version of msbuild -->
<property name ="msbuild.exe" value="msbuild"/> <!-- default-->
<property name="windows.dir" value="${environment::get-variable('windir')}"/>
<property name="net3.5.dir" value="${windows.dir}/Microsoft.NET/Framework/v3.5"/>
<if test="${directory::exists(net3.5.dir)}">
<property name="msbuild.exe" value="${net3.5.dir}/msbuild.exe"/>
</if>
<!-- current nant msbuild task is unable to build VS.NET 2008 solutions -->
<!-- let's try run correct msbuild.exe via the exec task -->
<exec program ="${msbuild.exe}" verbose="true">
<arg value="/property:TeamOutPath=Release\FS.IPSA.WebAdmin" />
<arg value="FS.IPSA.WebAdmin\FS.IPSA.WebAdmin.csproj"/>
</exec>https://stackoverflow.com/questions/3504728
复制相似问题