PC Review


Reply
Thread Tools Rate Thread

Compiling from vbc.exe using process class

 
 
emailallrise
Guest
Posts: n/a
 
      15th Dec 2003
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,System.Windows.Forms.dll,Sy
stem.Xml.dll,..\mydlls\bin\mydlls.dll /target:exe
/imports:Microsoft.VisualBasic,System,System.Collections,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.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling and Loading C# class on the fly =?Utf-8?B?Um9uIEphbWVz?= Microsoft Dot NET 2 20th Dec 2005 02:37 PM
Prevent reording of class layout when compiling Raymond Lewallen Microsoft Dot NET 0 24th Mar 2005 10:21 PM
Errors when Compiling a Class File Joe via DotNetMonster.com Microsoft ASP .NET 3 16th Mar 2005 06:10 AM
Compiling C++ class project to a dll =?Utf-8?B?andr?= Microsoft Dot NET Framework 2 31st Jan 2005 06:49 PM
Using a class without compiling it Paul Darroch Microsoft ASP .NET 1 5th Apr 2004 02:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:03 PM.