Hi ya all,
I'v made a simple app that reads the *.vbproj file and generates a command
line that I can execute on the console to compile my app. Now I modified my
app so that by using the process class I can compile it right from the app
that makes the command line. But its not working.
I use the following code :
private void buildfromcommandline()
{
Process prc= new Process ();
if (System.IO.File.Exists(txtvbcpath.Text ))
{
prc.StartInfo.FileName=txtvbcpath.Text ;
prc.StartInfo.Arguments=txtcommandline.Text ;
prc.StartInfo.UseShellExecute= false;
prc.StartInfo.RedirectStandardOutput =true;
prc.StartInfo.RedirectStandardError=true;
/*Directory.SetCurrentDirectory(txtprojectfile.Text .Substring (0,
txtprojectfile.Text.LastIndexOf(@"\")));*/
prc.Start();
txtcommandline.Text =prc.StandardOutput.ReadToEnd();
}
else
MessageBox.Show ("Please locate and set the correct path to your
VBC.exe!","VBC.exe not found!");
}
is the code correct ?
Following is a sample command line:
C:\WINNT\Microsoft.NET\Framework\v1.1.4322\vbc.exe
"/libpath:C:\WINNT\Microsoft.NET\Framework\v1.1.4322 " /rootnamespace:winapp1
/r:System.dll,System.Data.dll,System.Drawing.dll,Sy stem.Windows.Forms.dll,Sy
stem.Xml.dll,..\mydlls\bin\mydlls.dll /target:exe
/imports:Microsoft.VisualBasic,System,System.Collec tions,System.Data,System.
Drawing,System.Diagnostics,System.Windows.Forms /out:c:\winapp1.exe
C:\tempvswork\winapp1\AssemblyInfo.vb C:\tempvswork\winapp1\CTasks.vb
C:\tempvswork\winapp1\Form1.vb C:\tempvswork\winapp1\myform.vb
Now I also want to set the directory such that the relative paths as
mentioned in the *.vbproj file works instead giving it the absolute file
paths as I'v done above.
Thanx.
Abubakar.