Question: I'm trying to learn C# by watching tutorials and when I try to rename my class it gives me this

So this first error is basically when I make a new console solution and then declare a class and give it a name and then try to write out to the console it gives me two errors.

> 
> ![1ST:Error 1 Invalid token '(' in class, struct, or interface member
>  declaration C:\Users\Alan\AppData\Local\Temporary
>  Projects\ConsoleApplication1\Program.cs 10 23 ConsoleApplication1
> 
> 
> 2ND : Error 2 The type name 'Writeline' does not exist in the type
>  'System.Console' C:\Users\Alan\AppData\Local\Temporary
>  Projects\ConsoleApplication1\Program.cs 10 13 ConsoleApplication1
> 
> 
> 

I clicked an save all and saved it to a folder on my desktop where I plan to put all my C# files but I get those errors and when I start out a new document clean it and write the console commands and build it doesnt give me any errors. 

Is it that I need a constructor or that I need to save my files in a specific order or what?.
][1](http://i.stack.imgur.com/vOtcl.jpg)

Answer: 
It looks like you have a call to `System.Console.WriteLine` outside of the body of a method. The compiler thinks you are trying to reference a type, which does not exist, and it is also telling you that `(` is not legal at that particular point in the code file. 

You likely have a class definition that might look something like this 

```
class Program
{
     System.Console.WriteLine("hello world");
}

```

What you need is a class definition that looks more like 

```
class Program
{
     public static void Main(string[] args)
     {
          System.Console.WriteLine("hello world");
     }
}

```
It seems that you've blown away the `Main()` method. Also, you shouldn't (can't, I guess) just have a method call floating in a class - it has to be within a method or constructor. 

Try replacing the contents within `namespace ConsoleApplication1` with the below get you started:

```
class Program
{
    static void Main(string[] args)
    {
        Person alan = new Person();
        alan.PersonName = "Alan";

        Console.WriteLine("Hi " + alan.PersonName);
        Console.ReadLine();
    }
}

class Person
{
    public string PersonName { get; set; }
}

```

**PS.** You probably should have Person in a separate file (e.g. Person.cs) but for getting started this should do....not the ideal end state, though.