使用 Nant 构建 .NET 4 项目 [英] Building .NET 4 projects with Nant
问题描述
如何才能构建面向 .NET 4.0 Framework 的项目?
How do I get nant to build projects that target the .NET 4.0 Framework?
推荐答案
2010 年 4 月 15 日,...在 .net 4 和 vs2010 发布后,更新 Eugene 的上述正确答案.
2010 April 15, ... Update to above correct answer from Eugene, after .net 4 and vs2010 was released.
我下载了 vs2010 和 .net 4 运行时.生产版本好像是v4.30319 ie (C:WINDOWSMicrosoft.NETFrameworkv4.0.30319)
I downloaded vs2010 and .net 4 runtime. The production version seems to be v4.30319 ie (C:WINDOWSMicrosoft.NETFrameworkv4.0.30319)
查看后http://paigecsharp.blogspot.com/2009/08/nant-net-framework-40-configuration.html, ...我粘贴了文本并将所有文本从 v4.0.20506 更改为 v4.30319 an向 NAnt.exe.config 添加文本.
After reviewing http://paigecsharp.blogspot.com/2009/08/nant-net-framework-40-configuration.html, ... I pasted in the text and changed all text from v4.0.20506 to v4.30319 an added text to NAnt.exe.config.
然后我将我的 nant 脚本更新为
I then updated my nant script to
<property name="nant.settings.currentframework" value="net-4.0" />,
所以我的项目 nant 脚本使用 .net 4 编译器
this so my project nant script uses the .net 4 compiler
这让我用 .net 4 二进制文件构建了一个 nant ......
And this got me a nant build with .net 4 binary ....
更新 2010-06-14:上面的回答是 nant-0.85,我升级到 nant-0.90 并且不得不将 vendor="Microsoft"
添加到添加到 nants 配置的框架属性.此外,看起来 nant0.9 以不同的方式找到了 .net 库,因为我不得不将这样的内容添加到我的 nant build.xml ...
Update 2010-06-14: The above was answered with nant-0.85, I upgraded to nant-0.90 and had to add vendor="Microsoft"
to framework attribute that is added to nants config. Also, it looks like nant0.9 finds the .net libraries differently, as I had to add something like this to my nant build.xml ...
<property name="framework-get-assembly-directory" value="${framework::get-assembly-directory('net-4.0')}" />
<property name="dotNetReferenceAssemblyPath" value="${framework-get-assembly-directory}" />
和
<include name="${dotNetReferenceAssemblyPath}System.ComponentModel.DataAnnotations.dll" />
这篇关于使用 Nant 构建 .NET 4 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!