Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
607 views
in Technique[技术] by (71.8m points)

build - Building .NET 4 projects with Nant

How do I get nant to build projects that target the .NET 4.0 Framework?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

2010 April 15, ... Update to above correct answer from Eugene, after .net 4 and vs2010 was released.

I downloaded vs2010 and .net 4 runtime. The production version seems to be v4.30319 ie (C:WINDOWSMicrosoft.NETFrameworkv4.0.30319)

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.

I then updated my nant script to

<property name="nant.settings.currentframework" value="net-4.0" />, 

this so my project nant script uses the .net 4 compiler

And this got me a nant build with .net 4 binary ....

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}" />

and

<include name="${dotNetReferenceAssemblyPath}System.ComponentModel.DataAnnotations.dll" />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...