My computer has a working smartcard reader that should be returned by the code snippet below:
string selector = Windows.Devices.SmartCards.SmartCardReader.GetDeviceSelector();
Windows.Devices.Enumeration.DeviceInformationCollection devices = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(selector);
However, I am getting this error:
Error CS4036 '
IAsyncOperation<DeviceInformationCollection>
' does not contain a definition for 'GetAwaiter
' and no extension method 'GetAwaiter
' accepting a first argument of type 'IAsyncOperation<DeviceInformationCollection>
' could be found (are you missing a using directive for 'System
'?)
The code snippet is copied from Microsoft's C# Sample Code
What can I do to solve this error?