Building from command line

  • Thread starter Thread starter flopbucket
  • Start date Start date
F

flopbucket

Hi,

We are using Visual Studio.NET 2003 and need to build from command line
for integration with Cruise Control. Reading the docs, I see I can do:

c:\> devenv.exe /clean Debug example.sln

This build fine, however, it seems that is starts a background process
and the command prompt returns immediately. I need it to work like a
normal "make" in that it does not exit until the build completes/fails,
etc. Is there a way to do this?

Thanks
 
flopbucket said:
We are using Visual Studio.NET 2003 and need to build from command line
for integration with Cruise Control. Reading the docs, I see I can do:

c:\> devenv.exe /clean Debug example.sln

This build fine, however, it seems that is starts a background process
and the command prompt returns immediately.

The Windows command prompt returns, yes, but on a different command
prompt (such as the Cygwin Bash command prompt), it doesn't. What
happens if you put it in a Makefile or somesuch? Have you tried writing
a little utility like:

---8<---
using System;
using System.Text;
using System.Diagnostics;

class App
{
static int Main(string[] args)
{
try
{
Process process = new Process();

StringBuilder argList = new StringBuilder();
for (int i = 1; i < args.Length; ++i)
argList.AppendFormat(" \"{0}\"", args);

process.StartInfo = new ProcessStartInfo(
args[0], argList.ToString());
process.Start();
process.WaitForExit();
return process.ExitCode;
}
catch (Exception ex)
{
Console.Error.WriteLine(ex.Message);
return 255;
}
}
}
--->8---

and running:

WaitFor devenv /clean Debug example.sln

?

(Disclaimer: I no longer have VS 2003 installed, so I tested with VS
2005.)

-- Barry
 
Use console csc.exe from the .NET SDK

f> We are using Visual Studio.NET 2003 and need to build from command
f> line for integration with Cruise Control. Reading the docs, I see I
f> can do:
f>
f> c:\> devenv.exe /clean Debug example.sln
f>
f> This build fine, however, it seems that is starts a background
f> process and the command prompt returns immediately. I need it to
f> work like a normal "make" in that it does not exit until the build
f> completes/fails, etc. Is there a way to do this?

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
Back
Top