Console Application Testing

G

Guest

I'm going through a few code examples that are demonstrated using a Console
Application. But, for some reason I am unable to move forward with them. I
have two questions:

1. VBC.EXE (VBC.exe is not recognized as an internal or external command,
operable program or batch file.). Now, I have the full Visual Studio 2005
Professional Edition with C# and VB.Net installed. In order to compile my
console applications I need to use this command. What am I doing wrong?

2. I can't believe I'm asking this other question, but for some reason I am
drawing a complete blank right now. I've only started working on my first
application recently, so I'm new to a lot of this. I managed to compile my
application into an EXE once in the past, but I don't recall how I did this.
If I can manage to compile my Console Applications into an EXE I can then
test the code I'm working with. So, how do I compile my code project into a
EXE file?

Thanks,
Greg
 
B

Brian Gideon

I'm going through a few code examples that are demonstrated using a Console
Application. But, for some reason I am unable to move forward with them. I
have two questions:

1. VBC.EXE (VBC.exe is not recognized as an internal or external command,
operable program or batch file.). Now, I have the full Visual Studio 2005
Professional Edition with C# and VB.Net installed. In order to compile my
console applications I need to use this command. What am I doing wrong?

If you have Visual Studio then why not use it to build your project
instead of using the command line tools. By the way, the error sounds
like the vbc.exe cannot be found. Try checking the PATH environment
variable.
2. I can't believe I'm asking this other question, but for some reason I am
drawing a complete blank right now. I've only started working on my first
application recently, so I'm new to a lot of this. I managed to compile my
application into an EXE once in the past, but I don't recall how I did this.
If I can manage to compile my Console Applications into an EXE I can then
test the code I'm working with. So, how do I compile my code project into a
EXE file?

Since you have Visual Studio I'd just choose the console application
project template and press F5 to to compile and run.
 
T

Tom Shelton

I'm going through a few code examples that are demonstrated using a Console
Application. But, for some reason I am unable to move forward with them. I
have two questions:

1. VBC.EXE (VBC.exe is not recognized as an internal or external command,
operable program or batch file.). Now, I have the full Visual Studio 2005
Professional Edition with C# and VB.Net installed. In order to compile my
console applications I need to use this command. What am I doing wrong?

Just to answer the actual question, the problem is that the VB.NET
compiler is not in your path. If you want to do this from the command
line, then you would want to use the Visual Studio 2005 Command
Prompt.

Start->All Programs->Microsoft Visual Studio 2005->Visual Studio Tools-
Visual Studio 2005 Command Prompt

This will run a bat file on startup which will setup the environment
properly so that you can work with the commandline tools.
2. I can't believe I'm asking this other question, but for some reason I am
drawing a complete blank right now. I've only started working on my first
application recently, so I'm new to a lot of this. I managed to compile my
application into an EXE once in the past, but I don't recall how I did this.
If I can manage to compile my Console Applications into an EXE I can then
test the code I'm working with. So, how do I compile my code project into a
EXE file?

Thanks,
Greg

Build->Build Solution
 
J

Jialiang Ge [MSFT]

Hello Greg,

From your post, my understanding on this issue is: you wonder how to run
the Visual Basic compiler, and how to compile a project to exe with
vbc.exe. If I'm off base, please feel free to let me know.

For your first question, vbc.exe could be accessed in Visual Studio Command
Prompt (Windows Start menu -> All Programs -> Microsoft Visual Studio 2005
-> Visual Studio Tools -> Visual Studio 2005 Command Prompt). If you
directly run vbc.exe in Windows Command Prompt (Windows Start menu -> All
Programs -> Accessories -> Command Prompt), vbc.exe is not added into the
Path environment variable by default, and we may get the error message:
VBC.exe is not recognized as an internal or external command, operable
program or batch file. If you want to run the vbc.exe in Windows command
prompt, please add the vbc.exe path
(C:\windows\Microsoft.NET\Framework\[version]) to the Path environment
variable.

For you second question:
a). If you want to compile the project in command prompt with vbc.exe,
please refer to the sample command lines in MSDN article
http://msdn2.microsoft.com/en-us/library/4dehewf5(vs.80).aspx. For
instance, the command:
vbc /define:DEBUG=1 /optimize /out:File2.exe *.vb
will compile all Visual Basic files in the current directory, with
optimizations on and the DEBUG symbol defined, producing File2.exe
For more information about Visual Basic Compiler command options, see:
http://msdn2.microsoft.com/en-us/library/s4kbxexc(vs.80).aspx.

b). If you want to compile the project in Visual Studio IDE, please choose
Build -> Build Project in Visual Studio menu bar.

c). The third option is to use msbuild. Apart from allowing you to build
Visual Studio projects within or outside the Visual Studio IDE, MSBuild
also provides you with the ability to customize your own build process by
exposing a rich API for programming custom tasks and loggers. Please refer
to http://msdn2.microsoft.com/en-us/library/ms171479(vs.80).aspx to see how
to write a simple MSBuild project for a Visual Basic project.

Please let me know if you have any other concerns, or need anything else.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jialiang Ge [MSFT]

Hi Greg,

Would you mind letting me know the result of the suggestions? If you need
further assistance, feel free to let me know. I will be more than happy to
be of assistance.

Have a great day!

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top