Hello World FAIL

error CS0117: 'System.Console' does not contain a definition f

Page 1 of 1

4 Replies - 1394 Views - Last Post: 04 February 2010 - 06:39 AM Rate Topic: -----

#1 crackisgood4u  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 53
  • Joined: 11-February 09

Hello World FAIL

Posted 04 February 2010 - 03:35 AM

I get this error:

error CS0117: 'System.Console' does not contain a definition for 'Writeline'


When I try to compile this:


using System;


namespace HelloWordProgram
{
    class HelloWorld
    {
        static void Main(string[] args)
        {
           

            Console.WriteLine("Hello World!");
        }
    }
}




Am I missing some files? I am using Visual Studio Full version?

This post has been edited by crackisgood4u: 04 February 2010 - 03:37 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Hello World FAIL

#2 Ferencn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 71
  • View blog
  • Posts: 322
  • Joined: 01-February 10

Re: Hello World FAIL

Posted 04 February 2010 - 04:01 AM

My guess is that you accidentally typed 'Writeline' instead of 'WriteLine' (L of line Capitalized).
That is what the errormessage shows, even though the code you show us is correct.
Was This Post Helpful? 1
  • +
  • -

#3 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1253
  • View blog
  • Posts: 4,168
  • Joined: 27-January 10

Re: Hello World FAIL

Posted 04 February 2010 - 04:47 AM

You're missing a couple of using Statements.

Try this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            //Your code here.
        }
    }
}


Was This Post Helpful? 0
  • +
  • -

#4 Ferencn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 71
  • View blog
  • Posts: 322
  • Joined: 01-February 10

Re: Hello World FAIL

Posted 04 February 2010 - 04:54 AM

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}




Without your extra using statements compiles and executes just fine.
Intentionally modifying WriteLine to Writline generates the error that was quoted by the poster.

This post has been edited by Ferencn: 04 February 2010 - 04:57 AM

Was This Post Helpful? 0
  • +
  • -

#5 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1526
  • View blog
  • Posts: 5,961
  • Joined: 21-March 08

Re: Hello World FAIL

Posted 04 February 2010 - 06:39 AM

View Poststapia.gutierrez, on 04 February 2010 - 06:47 AM, said:

You're missing a couple of using Statements.

Try this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            //Your code here.
        }
    }
}



"System" is all that is needed for what he was doing.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1