Information and Links

Join the fray by commenting, tracking what others have to say, or linking to it from your blog.


Related Posts
Laziness .NET -- the Professional Edition
Some new MSDN links of note
Feeling the Cache Love
So many things going on at one time
Visual Studio .NET Bootstrapper Plug-In

Creating a VB.NET Windows application using the command line

Posted on September 14th

Juanito27 posted this question to the VB.NET forum on GotDotNet last week...

Command line compile Windows vb app
I need to have someone show me how to compile via command line a vb.net windows app. Could someone show me the minimum code to get a window/form up with maybe a label or button on it.

so I posted up a sample to the samples page on my personal site that shows creating two programs via the VB.NET command line compiler... first a console application, then a Windows Forms app... this page is a draft version of something I'm putting together for MSDN so let me know if you find it useful...



Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Hi

Great article. Really informative and simply.... What about having a table of available command line arguments with descriptions and examples when and why you would use each og them, or are there too many?

Cheers.

Really great work. Exactually what a beginner such as myself was looking for. Thank you!

If you have multiple forms, just add each .vb file onto your command line (vbc.exe form1.vb form2.vb form3.vb).... yep, devenv.exe works wonders but I was assuming that you don't have access to Visual Studio in this case.

does the executable work for people without the framework?

Nope, the framework is still required

so how do i compile it to run on other .net free platforms?

You can't ... you can create an install that will put the .NET Framework onto the target (client) machine, but it is not possible to run the application without the framework.

hmm. ok thanks

Hallo
Can someone help me to show on how to compile a vb.net file using the command line. I am a very basic beginner working on this compilation process. Help me out on how to do it, the commands to do it and where should I type the commands.

Looking forward to your help. Thanks in advance.

Please mail to raja@gunasekaran.net

I messed up my VS.net VB part - so I had to compile my ASP.net app from CMD prompt:

1. Edit the PATH environment variable to include C:\WINNT\Microsoft.NET\Framework\v1.1.4322

2. browse to your webapp directory:
cd Inetpub\wwwroot\VoucherInvoice

3. The execute following (instead of linebreaks - use spaces):

vbc
/recurse:*.vb
/t:library
/rootnamespace:VoucherInvoice
/out:bin/VoucherInvoice.dll

/r:System.dll
/r:System.Web.dll
/r:Microsoft.VisualBasic.dll
/r:System.XML.dll
/r:System.Data.dll
/r:System.Drawing.dll

/r:bin/ML_controls.dll
/r:bin/ML_DataAccess.dll
/r:bin/MetaBuilders.WebControls.DefaultButtons.dll

/imports:System,System.Data,System.Data.SqlClient,System.Configuration,System.Drawing,
System.Web,System.Web.UI,System.Web.SessionState,System.Web.UI.WebControls,
System.Web.UI.HtmlControls,Microsoft.VisualBasic

i wanna use System.Web.UI features in windows application.For Eg,
In web application, its possible to convert memory stream into a PDF.
How will i do thet in windows application.
Can anyone guide me??

pls mail me to minisel2003@yahoo.co.in

Nice !! thanks for your help about creating command line in vb.net ^^

Hello,

Is there a way to determine the command-line equilvalent for an existing Visual Studio project?

This would be useful for automaticing release builds.