By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,510 Members | 1,821 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,510 IT Pros & Developers. It's quick & easy.

Trouble Compiling a Console Application at the Command Prompt

P: 1
I'm new to vb.net and I have a very simple console application. When I attempt to compile it at the command prompt I get error BC30420 Sub Main not found. I know the namespace and module name but that does not seem to work. Here is my code:

Expand|Select|Wrap|Line Numbers
  1. Imports System
  2.  
  3. Module Hello
  4.  
  5.     Sub Main()
  6.  
  7.         Dim Today As Date
  8.  
  9.         System.Console.WriteLine("Name")
  10.         System.Console.WriteLine("Class")
  11.         System.Console.WriteLine("Instructor")
  12.         System.Console.WriteLine("Today's Date:  " & Today)
  13.  
  14.     End Sub
  15.  
  16. End Module

At the command prompt I enter:


vbc /main:ConsoleApplication1.Hello /out:Hello.exe Hello.vb

The root namespace on the application properties window is the name of the folder where the solution is located and Sub Main is selected as the startup object.

What's wrong with this picture?????

Any help is appreciated greatly

Ceci
Sep 10 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
VB.Net is totally beyond my experience. But I wonder whether perhaps you need to specify Main as Public.
Sep 10 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.