Task is not waiting for completion <p>I'm trying to get my head around await and async so I wrote this little test app, but what I expected does not happen.</p> <p>Instead of waiting for the task to complete, the program continues to execute.</p> <pre><code>class Program { static void Main(string[] args) { var task = new Task(Run); task.Start(); task.Wait(); Console.WriteLine("Main finished"); Console.ReadLine(); } public async static void Run() { var task = Task.Factory.StartNew(() =&gt; { Console.WriteLine("Starting"); Thread.Sleep(1000); Console.WriteLine("End"); }); await task; Console.WriteLine("Run finished"); } } </code></pre> <p>Output</p> <pre><code>Main finished Starting End Run finished </code></pre> <p>If I swap the 'await task' for 'task.Await()' it then runs as I would have expected producing</p> <pre><code>Starting End Run finished Main finished </code></pre>