I've created a console application that takes a sample text file in and processes it. This works fine when I'm debugging it through Visual Studio but when I attempt to run it from the command line the argument is not passed. 

My understanding is that I should be able to run the application by calling it and passing the argument like :

application argument

Which in my case would be something like this :
C:\Users\Alex\Desktop\ConsoleApplication2.application C:\Users\Alex\Documents\Sample.txt

Is there something obvious I'm missing? 

However doing this generates the following exception :
 "Unhandled Exception: System.IndexOutOfRangeException: Index was outside the bounds of the array. at ConsoleApplication2.TestProgram.Main(String[] args)"

The argument should be access through the C# code as follows

```
public static void Main(string[] args)
        {
            System.Console.WriteLine(args[0]);
            // Read the file as one string.
            string text = System.IO.File.ReadAllText(@args[0]);
...
...
rest of method here
...
...

```

}