Running builds using .net 3.5 MSBuild and NantContrib

孤者浪人 提交于 2019-12-23 05:05:15

问题


I noticed that projects that were originally created in VS 2008 do not compile using the nantcontrib msbuild task. There is a solution that I've seen here but it seems like a bit of a hack, considering 'MSBuildBinPath' has been depricated, and I don't exactly like the idea of changing this property on every single project file that I create in VS 2008.

Short of changing build scripts to call msbuild through an exec task, is there any way to point the msbuild task at a particular version of MSBuild? Perhaps this is in the works for the next release of Nant?


回答1:


There is another option, calling MsBuild.exe directly.

Here's an example:

<property name="MSBuildPath" value="C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe"/>    
    <target name="build">
        <exec program="${MSBuildPath}">
            <arg line='"${SolutionFile}"' />
            <arg line="/property:Configuration=${SolutionConfiguration}" />
            <arg value="/target:Rebuild" />
            <arg value="/verbosity:normal" />
            <arg value="/nologo" />
        </exec>
    </target>

If you're calling Nant from Cruise Control .NET, you can also add this argument:

<arg line='/logger:"C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll"'/>



回答2:


Either use this hack or upgrade to nant 0.86 beta-1 or newer



来源:https://stackoverflow.com/questions/626774/running-builds-using-net-3-5-msbuild-and-nantcontrib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!