Demonpiggies
Programmer
I'm trying to eliminate our dependence on batch files for compiling our many projects. I am forced to use a huge batch file to create our installation and am just tired of all my co-workers' questions about how to compile certain projects. So I'm trying to create an application in C# that will dynamically compile, register, delete, etc the projects that a specific project.
The problem I'm having is that I cannot execute commandline code from C#. I used the examples that I've found on MSDN, CodeGuru, etc. and below is what I've come up with. I've used the code from the batch file that is supposed to usable by commandline. But when I run the code below all I get is a cmd window that points to the debug folder of the project itself (not the one I need compiled).
Here's most of my code, or at least the portion that will execute the commandline:
//--- create process member
System.Diagnostics.Process compilerProcess;
compilerProcess = new System.Diagnostics.Process();
compilerProcess.EnableRaisingEvents = false;
compilerProcess.StartInfo.FileName = @"C:\\windows\\system32\\CMD.exe";
compilerProcess.StartInfo.Arguments = "C:\\Program Files\\Microsoft Visual Studio\\COMMON\\msdev98\\Bin\\msdev.exe c:\\cql\\source\\mainline\\souce\\create\\cql.dsw /MAKE cql_ii - Win32 Release";
compilerProcess.StartInfo.UseShellExecute = false;
compilerProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
compilerProcess.StartInfo.CreateNoWindow = true;
compilerProcess.StartInfo.RedirectStandardOutput = true;
compilerProcess.Start();
compilerProcess.WaitForExit();
rtfOutput.Text = compilerProcess.StandardOutput.ReadToEnd().ToString();
compilerProcess.Close();
Any help in this is appreciated...
The problem I'm having is that I cannot execute commandline code from C#. I used the examples that I've found on MSDN, CodeGuru, etc. and below is what I've come up with. I've used the code from the batch file that is supposed to usable by commandline. But when I run the code below all I get is a cmd window that points to the debug folder of the project itself (not the one I need compiled).
Here's most of my code, or at least the portion that will execute the commandline:
//--- create process member
System.Diagnostics.Process compilerProcess;
compilerProcess = new System.Diagnostics.Process();
compilerProcess.EnableRaisingEvents = false;
compilerProcess.StartInfo.FileName = @"C:\\windows\\system32\\CMD.exe";
compilerProcess.StartInfo.Arguments = "C:\\Program Files\\Microsoft Visual Studio\\COMMON\\msdev98\\Bin\\msdev.exe c:\\cql\\source\\mainline\\souce\\create\\cql.dsw /MAKE cql_ii - Win32 Release";
compilerProcess.StartInfo.UseShellExecute = false;
compilerProcess.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
compilerProcess.StartInfo.CreateNoWindow = true;
compilerProcess.StartInfo.RedirectStandardOutput = true;
compilerProcess.Start();
compilerProcess.WaitForExit();
rtfOutput.Text = compilerProcess.StandardOutput.ReadToEnd().ToString();
compilerProcess.Close();
Any help in this is appreciated...