473,386 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

VB.net program cannot be compiled in command line

I have the following simple "Hello, world" vb.net program named "prog01.vb" :

Module prog01
sub Main()
MsgBox("Hello, world!")
end sub
end Module

and compile it using vbc.exe as follows:

vbc /reference:Microsoft.VisualBasic.dll prog01.vb

but receive error messages as follows:

prog01.vb(3) : error BC30451: Name 'MsgBox' is not declared.

I have no Visual Studio.NET but use .NET Framework SDK 1.1 instead.
Could anyone pls tell me what's wrong with the program or the
compilation process?
Nov 20 '05 #1
1 1715
Lovely Dola,
The /reference on the command line only allows you to use the Types
(classes, modules, structures, delegates, and interfaces) within the listed
assembly.

You also need to either give the fully name or import the namespace where
MsgBox is.

Either of the following should work (along with the /reference on the
command line):

Imports Microsoft.VisualBasic
Module prog01
sub Main()
MsgBox("Hello, world!")
end sub
end Module
Module prog01
sub Main()
Microsoft.VisualBasic.Interaction.MsgBox("Hello, world!")
end sub
end Module
Hope this helps
Jay

"Lovely Dola" <do**@webinhk.com> wrote in message
news:ff*************************@posting.google.co m... I have the following simple "Hello, world" vb.net program named "prog01.vb" :
Module prog01
sub Main()
MsgBox("Hello, world!")
end sub
end Module

and compile it using vbc.exe as follows:

vbc /reference:Microsoft.VisualBasic.dll prog01.vb

but receive error messages as follows:

prog01.vb(3) : error BC30451: Name 'MsgBox' is not declared.

I have no Visual Studio.NET but use .NET Framework SDK 1.1 instead.
Could anyone pls tell me what's wrong with the program or the
compilation process?

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: me | last post by:
I have been looking online for a year, and cant find one. I used to use the int86() command in dos command-line mode, but it can't work in linux. I am using Allegro to make my program work, but I...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
7
by: alphatan | last post by:
Is there relative source or document for this purpose? I've searched the index of "Mastering Regular Expression", but cannot get the useful information for C. Thanks in advanced. -- Learning...
8
by: Quentin Huo | last post by:
Hi: I want to run cacls.exe to check the user right from an ASPX page. In ASP, I can do: Set wshobj=Server.CreateObject("WScript.Shell") resobj=wshobj.Run("cmd /c echo Y| cacls c:", 0, True)...
0
by: Simone Chiaretta | last post by:
I'm having a problem with webservices: from times to times I get the following error (incapsulated in a SOAP Exception) It seems like each time I call a webservice, something is auto-generated...
9
by: santosh | last post by:
Hello all, I've put together a small program to count the number of characters and 'words' in a text file. The minimum length of a word, (in terms of no. of characters), as well as word...
3
by: newshop | last post by:
Dear Guru, this is about command-line argument program. is it possible to generate excel file with the command line program ? example of the argurment is: C:\test.exe <filename.txt>, which I...
4
by: Billy | last post by:
Hi! I'm using: -Compiler: Borland Command Line C++ Compiler 5.5.1 -Code Editor: SciTE 1.75 Anybody know how we can in Scite with command Tools|Go (F5) compile and run my c or cpp program at...
5
by: CSharper | last post by:
Please tell me what am I doing wrong in the following; I have a WPF program that I build it in IDE and ran it, it runs fine. I wanted to make it an exe through command line compiler(why, I need...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.