私のコンピューターには、以下のコード スニペットによって返される動作中のスマートカード リーダーがあります。
string selector = Windows.Devices.SmartCards.SmartCardReader.GetDeviceSelector();
Windows.Devices.Enumeration.DeviceInformationCollection devices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(selector);
ただし、次のエラーが発生します。
エラー CS4036 '
IAsyncOperation<DeviceInformationCollection>
' には ' ' の定義が含まれておらず、タイプ ' ' の最初の引数を受け入れるGetAwaiter
拡張メソッド ' 'が見つかりませんでした (' ' の using ディレクティブがありませんか?)GetAwaiter
IAsyncOperation<DeviceInformationCollection>
System
コード スニペットは、Microsoft の C# サンプル コードからコピーしたものです。
このエラーを解決するにはどうすればよいですか?