使用 .net 3.5 MSBuild 和 NantContrib 运行构建

发布于 2024-07-15 04:41:16 字数 352 浏览 3 评论 0原文

我注意到最初在 VS 2008 中创建的项目不使用 nantcontrib msbuild 任务进行编译。 我在​​此处看到了一个解决方案,但看起来像考虑到“MSBuildBinPath”已被废弃,我不太喜欢在 VS 2008 中创建的每个项目文件上更改此属性的想法。

缺少更改构建脚本以通过 exec 调用 msbuild任务,有没有办法将 msbuild 任务指向特定版本的 MSBuild? 也许这是 Nant 下一版本的开发工作?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

逆光飞翔i 2024-07-22 04:41:16

还有另一种选择,直接调用 MsBuild.exe。

下面是一个示例:

<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>

如果您从 Cruise Control .NET 调用 Nant,您还可以添加以下参数:

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

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"'/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文