1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HelloWorld program can compile but no output shown on console

Discussion in 'C#' started by tech_girl, Jun 6, 2010.

  1. tech_girl

    tech_girl New Member

    Joined:
    Jun 6, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Hi all,

    I'm a C# beginner. Managed to download and set up the environment for C# programming. I have downloaded and installed the .Net Framework 2.0 and its corresponding SDK.

    I compiled a HelloWorld program. No error was shown on the console so I believe it has compiled successfully but it doesn't show "Hello World".


    C:\MyProgram>csc HelloWorld.cs
    Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3053
    for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
    Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.


    C:\MyProgram>


    Can anyone shed light on this? Is this a setup issue?
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    Share your code
     
  3. tech_girl

    tech_girl New Member

    Joined:
    Jun 6, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Here is the code:

    using System;
    public class HelloWorld
    {
    public static void Main() {
    Console.Write("Hello World!");
    }
    }
     
  4. tech_girl

    tech_girl New Member

    Joined:
    Jun 6, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Here is the code:

    using System;
    public class HelloWorld
    {
    public static void Main() {
    Console.Write("Hello World!");
    }
    }
     
  5. tech_girl

    tech_girl New Member

    Joined:
    Jun 6, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Oops...apologies for the double post.
     
  6. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    And why are you trying to run the program using console. Do you have the Editor?
     
  7. tech_girl

    tech_girl New Member

    Joined:
    Jun 6, 2010
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    0
    Issue resolved.

    Yesterday I installed VS2005.
     

Share This Page