LoginSignup
0
1

More than 5 years have passed since last update.

Visual Studio / WPF > IDE > IntelliSense > Task.Run()の候補表示 > 関数にasyncを追加

Last updated at Posted at 2017-04-27
動作環境
Windows 7 Pro (32bit)
Microsoft Visual Studio 2017 Community
Sublime Text 2

@ WPF 4.5入門 by 大田一希さん
No.5290 / 9985

            try
            {
                await Task.Run(() => d.DoSomething());
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Line45");
                Debug.WriteLine(ex);
                Debug.WriteLine("Line47");
            }

上記のようなコードを入力中にTask.Run()の入力候補がインテリセンスで表示されなかった。

Task.Run()の名前空間は System.Threading.Tasksであり、すでにusing文を記載済み。

関数定義にasyncをつけないといけないようだ。

候補表示なし

private void Button2_Click(object sender, RoutedEventArgs e)

候補表示あり

private async void Button2_Click(object sender, RoutedEventArgs e)

async(非同期)については、今は追わない。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1