473,498 Members | 891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2379
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
463
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
7124
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
7163
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,...
0
7200
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...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.