Namespace error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dharma

    #1

    Namespace error

    Hello,
    I am trying to compile this "hello world" program but it gives me this
    following error,
    "A namespace does not directly contain members such as fields or methods"
    Can someone pelse help me with this?
    Here's my code:
    Using System;

    namespace Helloworld
    {
    class Helloworldindos
    {
    static void Main()
    {
    Console.WriteLi ne("Hello World");
    }
    }
    }


  • Jon Skeet [C# MVP]

    #2
    Re: Namespace error

    Dharma <t-seeraj@microsof t.com.NO_SPAM> wrote:[color=blue]
    > Hello,
    > I am trying to compile this "hello world" program but it gives me this
    > following error,
    > "A namespace does not directly contain members such as fields or methods"
    > Can someone pelse help me with this?
    > Here's my code:[/color]
    [color=blue]
    > Using System;[/color]

    This line is the problem. C# is case-sensitive - that should be
    "using" rather than "Using".

    --
    Jon Skeet - <skeet@pobox.co m>
    Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

    If replying to the group, please do not mail me too

    Comment

    • Dharma

      #3
      Re: Namespace error

      Thanks Jon
      "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
      news:MPG.1a3033 61f4d7d892989b5 0@msnews.micros oft.com...[color=blue]
      > Dharma <t-seeraj@microsof t.com.NO_SPAM> wrote:[color=green]
      > > Hello,
      > > I am trying to compile this "hello world" program but it gives me[/color][/color]
      this[color=blue][color=green]
      > > following error,
      > > "A namespace does not directly contain members such as fields or[/color][/color]
      methods"[color=blue][color=green]
      > > Can someone pelse help me with this?
      > > Here's my code:[/color]
      >[color=green]
      > > Using System;[/color]
      >
      > This line is the problem. C# is case-sensitive - that should be
      > "using" rather than "Using".
      >
      > --
      > Jon Skeet - <skeet@pobox.co m>
      > http://www.pobox.com/~skeet
      > If replying to the group, please do not mail me too[/color]


      Comment

      • Tony!

        #4
        Re: Namespace error

        1On Thu, 27 Nov 2003 12:24:42 -0500, "Dharma"
        <t-seeraj@microsof t.com.NO_SPAM> wrote:
        [color=blue]
        >Thanks Jon
        >"Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
        >news:MPG.1a303 361f4d7d892989b 50@msnews.micro soft.com...[color=green]
        >> Dharma <t-seeraj@microsof t.com.NO_SPAM> wrote:[color=darkred]
        >> > Hello,
        >> > I am trying to compile this "hello world" program but it gives me[/color][/color]
        >this[color=green][color=darkred]
        >> > following error,
        >> > "A namespace does not directly contain members such as fields or[/color][/color]
        >methods"[color=green][color=darkred]
        >> > Can someone pelse help me with this?
        >> > Here's my code:[/color]
        >>[color=darkred]
        >> > Using System;[/color]
        >>
        >> This line is the problem. C# is case-sensitive - that should be
        >> "using" rather than "Using".
        >>
        >> --
        >> Jon Skeet - <skeet@pobox.co m>
        >> http://www.pobox.com/~skeet
        >> If replying to the group, please do not mail me too[/color]
        >[/color]

        I'm also at the "Hello World" phase of learning C#..

        Memorizing the proper case for various keywords looks like it will
        take a bit of time!

        Gonna make a good go at it though :)

        Tony!


        Comment

        Working...