nant multitarget support?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

nant multitarget support?

Stefan Arn

I have C# code with 4.0 language features that need a C#4.0 compiler to compile. But the resulting code should run on .NET Framework 3.5. This is possible with VS2010 by simply selecting the target framework 3.5. But I had no luck with NAnt.

 

Is it possible to use the 4.0 compiler and target the 3.5 framework? I already tried to change the framework configuration in NAnt.exe.config without success. I also looked around for an option to specify the compiler exe file on the csc NAnt task.

 

What should I do? Any suggestions?


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
NAnt-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nant-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: nant multitarget support?

Bob Archer

Yes… use MSBuild… specify target framework of 4.0 to Nant… this will run MSBuild 4.0 which will use the c# 4.0 compiler… but MSBuild will correctly target the .Net 3.5 runtime.

 

BOb

 

From: Stefan Arn [mailto:[hidden email]]
Sent: Wednesday, September 05, 2012 5:19 AM
To: '[hidden email]'
Subject: [NAnt-users] nant multitarget support?

 

I have C# code with 4.0 language features that need a C#4.0 compiler to compile. But the resulting code should run on .NET Framework 3.5. This is possible with VS2010 by simply selecting the target framework 3.5. But I had no luck with NAnt.

 

Is it possible to use the 4.0 compiler and target the 3.5 framework? I already tried to change the framework configuration in NAnt.exe.config without success. I also looked around for an option to specify the compiler exe file on the csc NAnt task.

 

What should I do? Any suggestions?


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
NAnt-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nant-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: nant multitarget support?

Bevan Arps
In reply to this post by Stefan Arn
Fwiw, I've found the <csc> task too limiting.

Instead I use <exec> to run msbuild for either the whole solution or a specific project. This approach handles your scenario of using the C# 4.0 compiler to target .Net 3.5.

Keep smiling
Bevan.


From: Stefan Arn
Sent: 9/5/2012 9:18 PM
To: '[hidden email]'
Subject: [NAnt-users] nant multitarget support?

I have C# code with 4.0 language features that need a C#4.0 compiler to compile. But the resulting code should run on .NET Framework 3.5. This is possible with VS2010 by simply selecting the target framework 3.5. But I had no luck with NAnt.

 

Is it possible to use the 4.0 compiler and target the 3.5 framework? I already tried to change the framework configuration in NAnt.exe.config without success. I also looked around for an option to specify the compiler exe file on the csc NAnt task.

 

What should I do? Any suggestions?


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
NAnt-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nant-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: nant multitarget support?

Richard Birkby
I find the MSBuild task from NantContrib works perfectly.


Richard

On Sun, Sep 9, 2012 at 10:52 AM, Bevan Arps <[hidden email]> wrote:
Fwiw, I've found the <csc> task too limiting.

Instead I use <exec> to run msbuild for either the whole solution or a specific project. This approach handles your scenario of using the C# 4.0 compiler to target .Net 3.5.

Keep smiling
Bevan.


From: Stefan Arn
Sent: 9/5/2012 9:18 PM

To: '[hidden email]'
Subject: [NAnt-users] nant multitarget support?

I have C# code with 4.0 language features that need a C#4.0 compiler to compile. But the resulting code should run on .NET Framework 3.5. This is possible with VS2010 by simply selecting the target framework 3.5. But I had no luck with NAnt.

 

Is it possible to use the 4.0 compiler and target the 3.5 framework? I already tried to change the framework configuration in NAnt.exe.config without success. I also looked around for an option to specify the compiler exe file on the csc NAnt task.

 

What should I do? Any suggestions?


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
NAnt-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nant-users



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
NAnt-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nant-users
Loading...