473,404 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

nant exec task: i need the return code!

Hi, I couldn't find a nant user group here, so thought i'd try this.

I run an external program from nant (robocopy) and unfortunately, it
returns 1 on success. Nant interprets this as a failure. I want it to
continue when it gets a 1 back (and possibly certain other codes), but
fail otherwise. I know I could use failonerror=false but then it would
still continue even during a real error.

Is there a way to capture the return code into a variable when using
the <exec> nant task?

- Paul

Feb 15 '06 #1
1 4104
<pr*****@gmail.com> wrote:
Hi, I couldn't find a nant user group here, so thought i'd try this.

I run an external program from nant (robocopy) and unfortunately, it
returns 1 on success. Nant interprets this as a failure. I want it to
continue when it gets a 1 back (and possibly certain other codes), but
fail otherwise. I know I could use failonerror=false but then it would
still continue even during a real error.

Is there a way to capture the return code into a variable when using
the <exec> nant task?


Aside from any other options - couldn't you write a batch file or small
executable which launches another executable and does the appropriate
error code changing?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: hoochiegooch | last post by:
Hi, all. I have a couple of questions about NAnt. 1. Is there a better way to invoke NAnt from a C# "Master Test Rig" than shelling out? IOW, how should an ASP.NET web app or Windows Service...
2
by: HaukiDog | last post by:
Hi, I am trying to set up my C# web project to be compiled by NANT. Everything compiles and works fine within the IDE. I have a created a NANT build file which has a simple project tag, like...
0
by: muesliflakes | last post by:
I wish to run Nant from my own application. I have included NAnt.Core and NAnt.DotNetTasks and calling out to NAnt as follows. StringWriter consoleOut = new StringWriter( ); Console.SetOut(...
3
by: prabhupr | last post by:
Hi Folks Not sure if this is the right group, if not please re-direct me to the right one. Here is my question =============== When I compile my ASP.NET WEB project from VS 2005 (.NET...
4
by: harleybl | last post by:
Hello, I have a C++ mixed mode dll ( unmanaged/managed ) that wraps a C# dll to provide some functionality for Microsoft Excel. I am able to compile my solution fine in Visual Studio .NET 2003...
3
by: Me | last post by:
I have a simple solution file which I am looking to build using Nant However this is written in .net 2.0 and when I try building this .net 2.0, I get an error message saying "Microsoft Visual...
12
by: michael sorens | last post by:
So I have compiled a .dll file from a Visual Studio 2005 project containing a few dozen c# files. Now I want to automate this build using ant (have not yet looked at nant, but the rest of my...
0
by: james.mcdonagh | last post by:
Hi I am a newbie using nAnt for .net 2.0. As such I have not come across this bug before, and I would be happy of any help that you may be able to provide. In order to help I have included the...
1
by: John A Grandy | last post by:
Can't find anywhere else to post this : Within a nant loop, I'd like to first perform a simple db update (single column of single row in single table) and then trigger the running of nunit tests...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.