473,385 Members | 1,834 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,385 software developers and data experts.

Hello World without using VS.NET

Has anyone successfully created a Hello World program without using Visual
Studio.NET? If so, what IDE did you use and what namespaces did you import?

Thanks!

Andy Sutorius
Jul 21 '05 #1
24 2371
Step 1: Write the code

public class Hell

public static void Main(

System.Console.WriteLine("Hello, World.")

Step 2: Save and compile

(On command line) csc.exe HelloWorld.c

Step 3: Run it

HelloWorld.ex

Hello, World
Jul 21 '05 #2
Step 1: Write the code

public class Hell

public static void Main(

System.Console.WriteLine("Hello, World.")

Step 2: Save and compile

(On command line) csc.exe HelloWorld.c

Step 3: Run it

HelloWorld.ex

Hello, World
Jul 21 '05 #3
If you have the .NET SDK installed, you have all the compilers and linkers
and assemblies you need. You can use Notepad or any other text editor to
create and modify the source code, and then use the command line compilers
to create the executables. For instance, key in the following code in
Notepad and save it as Hello.cs. Then from a command window, type
csc Hello.cs
and you'll get Hello.exe. Run Hello.exe and you'll get the hello world
message in a command window.

Here's the code:

using System;

namespace HelloWorldInCSharp
{
class HelloWorldApp
{
static void Main(string[] args)
{
Console.WriteLine("Hello World from C#!");
Console.ReadLine();
}
}
}

The command line compilers and linkers can be used to build any kind of
application or library assembly. There are many command switches. Try csc /?
to get an idea of what's available.

I haven't personally done this since VS.Net was released, so I don't
remember what you need to set up in order to make this work so easily.
Probably some paths need to be set up in the execution environment for the
command window. Look at the SDK documentation to see what needs to be done
by way of environment variables.

If you don't have the .NET SDK, you can get it from the Microsoft site
(without charge, as I understand it).

Good luck,
Tom Dacon
Dacon Software Consulting
"Andy Sutorius" <an**@sutorius.com> wrote in message
news:oJ*******************@twister.southeast.rr.co m...
Has anyone successfully created a Hello World program without using Visual
Studio.NET? If so, what IDE did you use and what namespaces did you import?
Thanks!

Andy Sutorius

Jul 21 '05 #4
If you have the .NET SDK installed, you have all the compilers and linkers
and assemblies you need. You can use Notepad or any other text editor to
create and modify the source code, and then use the command line compilers
to create the executables. For instance, key in the following code in
Notepad and save it as Hello.cs. Then from a command window, type
csc Hello.cs
and you'll get Hello.exe. Run Hello.exe and you'll get the hello world
message in a command window.

Here's the code:

using System;

namespace HelloWorldInCSharp
{
class HelloWorldApp
{
static void Main(string[] args)
{
Console.WriteLine("Hello World from C#!");
Console.ReadLine();
}
}
}

The command line compilers and linkers can be used to build any kind of
application or library assembly. There are many command switches. Try csc /?
to get an idea of what's available.

I haven't personally done this since VS.Net was released, so I don't
remember what you need to set up in order to make this work so easily.
Probably some paths need to be set up in the execution environment for the
command window. Look at the SDK documentation to see what needs to be done
by way of environment variables.

If you don't have the .NET SDK, you can get it from the Microsoft site
(without charge, as I understand it).

Good luck,
Tom Dacon
Dacon Software Consulting
"Andy Sutorius" <an**@sutorius.com> wrote in message
news:oJ*******************@twister.southeast.rr.co m...
Has anyone successfully created a Hello World program without using Visual
Studio.NET? If so, what IDE did you use and what namespaces did you import?
Thanks!

Andy Sutorius

Jul 21 '05 #5
Wow. Thanks. By chance would you have this same simple app in VB.NET?

Sincerely,

Andy Sutorius
Jul 21 '05 #6
Wow. Thanks. By chance would you have this same simple app in VB.NET?

Sincerely,

Andy Sutorius
Jul 21 '05 #7
Tom Dacon <To**@t-dacons.com> wrote:
If you have the .NET SDK installed, you have all the compilers and linkers
and assemblies you need.
You don't even need the SDK installed - the .NET framework itself comes
with the C# and VB.NET compilers.
I haven't personally done this since VS.Net was released, so I don't
remember what you need to set up in order to make this work so easily.
Probably some paths need to be set up in the execution environment for the
command window. Look at the SDK documentation to see what needs to be done
by way of environment variables.


Just including the framework directory (eg
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322) on the path is enough.

I use csc all the time - it's much quicker to type in code in a quick
text editor and compile it using csc than it is to wait for VS.NET to
start up, find or create an appropriate solution/project, and then put
the code in, when it comes to quick programs for newsgroup posts, for
instance.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #8
Tom Dacon <To**@t-dacons.com> wrote:
If you have the .NET SDK installed, you have all the compilers and linkers
and assemblies you need.
You don't even need the SDK installed - the .NET framework itself comes
with the C# and VB.NET compilers.
I haven't personally done this since VS.Net was released, so I don't
remember what you need to set up in order to make this work so easily.
Probably some paths need to be set up in the execution environment for the
command window. Look at the SDK documentation to see what needs to be done
by way of environment variables.


Just including the framework directory (eg
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322) on the path is enough.

I use csc all the time - it's much quicker to type in code in a quick
text editor and compile it using csc than it is to wait for VS.NET to
start up, find or create an appropriate solution/project, and then put
the code in, when it comes to quick programs for newsgroup posts, for
instance.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #9
Andy Sutorius <an**@sutorius.com> wrote:
Wow. Thanks. By chance would you have this same simple app in VB.NET?


Option Strict On

Imports System

Class Test
Shared Sub Main()
Console.WriteLine ("Hello, world")
End Sub
End Class

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #10
Andy Sutorius <an**@sutorius.com> wrote:
Wow. Thanks. By chance would you have this same simple app in VB.NET?


Option Strict On

Imports System

Class Test
Shared Sub Main()
Console.WriteLine ("Hello, world")
End Sub
End Class

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #11
Jon,

Have you tried to compile a vb.net program like you mention using csc
(obviously using vbc)

Thanks,

Andy Sutorius
Jul 21 '05 #12
Jon,

Have you tried to compile a vb.net program like you mention using csc
(obviously using vbc)

Thanks,

Andy Sutorius
Jul 21 '05 #13
Hi Tom,

I have set up the Path, Lib and Include system variables and csc is
compiling quite nicely. However, VB.net is a different story. I am trying to
port over a C# console app to VB.NET but am getting confused with what is
"required" by VB.NET. Statements that VS.NET puts in automatically.

Jul 21 '05 #14
Hi Tom,

I have set up the Path, Lib and Include system variables and csc is
compiling quite nicely. However, VB.net is a different story. I am trying to
port over a C# console app to VB.NET but am getting confused with what is
"required" by VB.NET. Statements that VS.NET puts in automatically.

Jul 21 '05 #15
Andy
Jon is not correct re: vbc.exe being installed w/the .NET framework. It does require the .NET SDK (only the C# compiler is installed w/the framework
Once that is install the framework SDK you then need to either
A) Go to the console using the VS 2003 (or 2002) Command Promp
(Start->Programs->VS.NET 2003->VS.NET Tools->VS 2003 Command Prompt
[This is NOT the normal command prompt
-OR
B) Locate Corvars.bat (by default it is @ C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\corvars.ba
and add this location to the Path. (this will allow you to run vbc from any place, and from the "normal" comman
prompt

This proceedure is discribed in Programming Microsoft Visual Basic .NET, MS Press, by Francisco Balena (pp23-24) which I teach from and highly recommend

HTH

Cos Callis, MCAD
Jul 21 '05 #16
Andy
Jon is not correct re: vbc.exe being installed w/the .NET framework. It does require the .NET SDK (only the C# compiler is installed w/the framework
Once that is install the framework SDK you then need to either
A) Go to the console using the VS 2003 (or 2002) Command Promp
(Start->Programs->VS.NET 2003->VS.NET Tools->VS 2003 Command Prompt
[This is NOT the normal command prompt
-OR
B) Locate Corvars.bat (by default it is @ C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\corvars.ba
and add this location to the Path. (this will allow you to run vbc from any place, and from the "normal" comman
prompt

This proceedure is discribed in Programming Microsoft Visual Basic .NET, MS Press, by Francisco Balena (pp23-24) which I teach from and highly recommend

HTH

Cos Callis, MCAD
Jul 21 '05 #17
Andy Sutorius <an**@sutorius.com> wrote:
Have you tried to compile a vb.net program like you mention using csc
(obviously using vbc)


Absolutely. Just setting the path is all I needed to do.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #18
Andy Sutorius <an**@sutorius.com> wrote:
Have you tried to compile a vb.net program like you mention using csc
(obviously using vbc)


Absolutely. Just setting the path is all I needed to do.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #19
Cos Callis <an*******@discussions.microsoft.com> wrote:
Andy,
Jon is not correct re: vbc.exe being installed w/the .NET framework.
It does require the .NET SDK (only the C# compiler is installed w/the
framework)


I don't know whether that was true for 1.0 or not, but it's certainly
not true for 1.1.

I've just taken a clean Windows 2000 box and installed the .NET 1.1
Redistributable Package, and I was then able to compile and run the
simple hello world program I previously posted.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #20
Cos Callis <an*******@discussions.microsoft.com> wrote:
Andy,
Jon is not correct re: vbc.exe being installed w/the .NET framework.
It does require the .NET SDK (only the C# compiler is installed w/the
framework)


I don't know whether that was true for 1.0 or not, but it's certainly
not true for 1.1.

I've just taken a clean Windows 2000 box and installed the .NET 1.1
Redistributable Package, and I was then able to compile and run the
simple hello world program I previously posted.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #21
Hi Andy,

Will you be so kind next time not to multipost (send seperate messages to
different newsgroups)

You have a lot of answers in the VB.language group and Jon could not see
that, when you had sent this to those group in one line with a delimiter
between the addressed newsgroups, Jon would probably not even had taken time
to answer your VB. question.

However he has that ready because that is his sample to show that C# and
VB.net are when compiled almost the same.

:-)

Thanks in advance for the next time,

Cor
Jul 21 '05 #22
Hi Andy,

Will you be so kind next time not to multipost (send seperate messages to
different newsgroups)

You have a lot of answers in the VB.language group and Jon could not see
that, when you had sent this to those group in one line with a delimiter
between the addressed newsgroups, Jon would probably not even had taken time
to answer your VB. question.

However he has that ready because that is his sample to show that C# and
VB.net are when compiled almost the same.

:-)

Thanks in advance for the next time,

Cor
Jul 21 '05 #23
I just have to throw my 2 cents in here =]

You can also use the eclipse project now, which is open source try google
search to find it, to compile and run C# programs as well as VB.NET
programs. You just need the .NET SDK and so on installed and the appropriate
Eclipse modules. Take a look.

-Evan
"Andy Sutorius" <an**@sutorius.com> wrote in message
news:oJ*******************@twister.southeast.rr.co m...
Has anyone successfully created a Hello World program without using Visual
Studio.NET? If so, what IDE did you use and what namespaces did you import?
Thanks!

Andy Sutorius

Jul 21 '05 #24
I just have to throw my 2 cents in here =]

You can also use the eclipse project now, which is open source try google
search to find it, to compile and run C# programs as well as VB.NET
programs. You just need the .NET SDK and so on installed and the appropriate
Eclipse modules. Take a look.

-Evan
"Andy Sutorius" <an**@sutorius.com> wrote in message
news:oJ*******************@twister.southeast.rr.co m...
Has anyone successfully created a Hello World program without using Visual
Studio.NET? If so, what IDE did you use and what namespaces did you import?
Thanks!

Andy Sutorius

Jul 21 '05 #25

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

Similar topics

24
by: Andy Sutorius | last post by:
Has anyone successfully created a Hello World program without using Visual Studio.NET? If so, what IDE did you use and what namespaces did you import? Thanks! Andy Sutorius
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.