我最近發現了CTP異步庫,我想嘗試編寫一個玩具程序來熟悉新概念,但是我遇到了一個問題。 我相信代碼應該寫出來 Starting
stuff in the middle
task string
,但事實並非如此。這裏是我正在運行的代碼: namespace TestingAsync
{
class Program
{
static void Main(str
以下代碼,我儘量不工作每一個變化異步方法 - 無論DoSomething() : void和書面叫,或DoSomething() : Task,被稱爲與TaskEx.RunEx(),一些嘗試涉及.GetAwaiter().GetResult()。看到的錯誤包括:"Start may not be called on a task with null action","RunSynchronousl
做不好有在異步方法開始昂貴的代碼,第一await調用之前?該代碼是否應該用TaskEx.Run來代替? public async Task Foo()
{
// Do some initial expensive stuff.
// ...
// First call to an async method with await.
await DoSome