Creating a VB.NET Windows application using the command line

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…

Creating a VB.NET Windows application using the command line

14 Responses

  1. 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.

    Wayne Taylor September 14, 2004 at 8:58 am #
  2. Really great work. Exactually what a beginner such as myself was looking for. Thank you!

    Megan January 25, 2005 at 2:30 am #
  3. 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.

    Duncan Mackenzie January 25, 2005 at 4:25 pm #
  4. does the executable work for people without the framework?

    nick July 13, 2005 at 3:43 pm #
  5. Nope, the framework is still required

    Duncan Mackenzie July 13, 2005 at 3:59 pm #
  6. so how do i compile it to run on other .net free platforms?

    nick July 13, 2005 at 8:42 pm #
  7. 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.

    Duncan Mackenzie July 13, 2005 at 8:53 pm #
  8. hmm. ok thanks

    nick July 13, 2005 at 8:59 pm #
  9. 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

    Raj July 15, 2005 at 10:31 am #
  10. 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

    LazyDev September 16, 2005 at 8:43 pm #
  11. 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??

    NaliniSelvam November 28, 2006 at 2:31 pm #
  12. pls mail me to minisel2003@yahoo.co.in

    NaliniSelvam November 28, 2006 at 2:35 pm #
  13. Nice !! thanks for your help about creating command line in vb.net ^^

    Odessa April 11, 2007 at 10:00 am #
  14. 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.

    John Simmons June 25, 2007 at 10:05 pm #

Leave a Reply