title: Entry point can be marked with the 'async' modifier on CoreCLR?
body: <p>In Stephan Cleary's recent blog post about <a href="http://blog.stephencleary.com/2015/03/async-console-apps-on-net-coreclr.html" rel="nofollow noreferrer">Async Console Apps on .NET CoreCLR</a> he shows us that in CoreCLR (currently running on Visual Studio 2015, CTP6), the entry point "Main" can actually be marked as <code>async Task</code>, compile properly and actually run:</p>
  
  <pre><code>public class Program
  {
      public async Task Main(string[] args)
      {
          Console.WriteLine("Hello World");
          await Task.Delay(TimeSpan.FromSeconds(1));
          Console.WriteLine("Still here!");
          Console.ReadLine();
      }
  }
  </code></pre>
  
  <p>Gives the following output:</p>
  
  <p><img src="https://i.stack.imgur.com/ItfnG.png" alt="async Main entry point"></p>
  
  <p>This is strengthend by a blog post from the ASP.NET team called <a href="https://msdn.microsoft.com/en-us/magazine/dn913182.aspx" rel="nofollow noreferrer">A Deep Dive into the ASP.NET 5 Runtime</a>:</p>
  
  <blockquote>
    <p>In addition to a static <code>Program.Main</code> entry point, the KRE supports
    instance-based entry points. You can even make the main entry point
    asynchronous and return a Task. By having the main entry point be an
    instance method, you can have services injected into your application
    by the runtime environment.</p>
  </blockquote>
  
  <p>We know that up until now, <a href="https://stackoverflow.com/questions/16712172/an-entry-point-cannot-be-marked-with-the-async-modifier">An entry point cannot be marked with the &#39;async&#39; modifier</a>. So, how is that actually possible in the new CoreCLR runtime?</p>