VS2013调试/ Windows /任务:“没有要显示的任务”

我有Visual Studio Professional 2013,我正在调试一个广泛使用async / await的应用程序。 但是当我在断点处停止并打开Debug / Windows / Tasks窗口时,它总是说“没有要显示的任务”。

我做了两个测试,在一个我可以看到任务,在另一个我不能(我运行程序,并暂停它)。 或者我可以在等待任务线时断点。

using System; using System.Threading; using System.Threading.Tasks; namespace TasksDebugWindowTest { class Program { static void Main(string[] args) { DoesNotWork(); } static void Works() { Console.WriteLine("Starting"); var t = Task.Factory.StartNew(() => { Task.Delay(100 * 1000).Wait(); Console.WriteLine("Task complete"); }); Console.WriteLine("Status: {0}", t.Status); Thread.Sleep(500); Console.WriteLine("Status: {0}", t.Status); t.Wait(); Console.WriteLine("Done"); } static void DoesNotWork() { Console.WriteLine("Starting"); var t = Task.Delay(100 * 1000); t.Wait(); // **** Breakpoint here Console.WriteLine("Task complete"); } } } 

任何人都能解释为什么我可以在一个案例中看到任务而在另一个案例中看不到

来自http://blogs.msdn.com/b/dotnet/archive/2013/06/26/announcing-the-net-framework-4-5-1-preview.aspx

 In Windows 8.1 Preview, the OS has an understanding of asynchronous operations and the states that they can be in, which is then used by Visual Studio 2013 preview, in this new window [Tasks] 

鉴于@ScottChamberlain确认Visual Studio中的任务窗口适用于Win8.1而不适用于Win7,这似乎是问题所在。