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

Hello World without using VS.NET

P: n/a
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
Share this Question
Share on Google+
24 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
Wow. Thanks. By chance would you have this same simple app in VB.NET?

Sincerely,

Andy Sutorius
Jul 21 '05 #6

P: n/a
Wow. Thanks. By chance would you have this same simple app in VB.NET?

Sincerely,

Andy Sutorius
Jul 21 '05 #7

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.