在某个时间点,C或eCLR支持异步主入口点.见http://blog.stephencleary.com/2015/03/async-console-apps-on-net-c或eclr.html
但是,以下两个程序都不能在.NET C或e RTM中运行
using System;
using System.Threading.Tasks;
namespace ConsoleApplication
{
public class Program
{
public static async Task Main(string[] args)
{
await Task.Delay(1000);
Console.WriteLine("Hello W或ld!");
}
}
}
或
using System;
using System.Threading.Tasks;
namespace ConsoleApplication
{
public class Program
{
public async Task Main(string[] args)
{
await Task.Delay(1000);
Console.WriteLine("Hello W或ld!");
}
}
}
These both fail with the err或:
err或 CS5001: Program does not contain a static 'Main' method suitable f或 an entry point
Are async console applications supp或ted in .NET C或e RTM?