I have the following code that shows a File Picker in an application:
var FilePicker = new Windows.Storage.Pickers.FileOpenPicker();
FilePicker.ViewMode = Windows.Storage.Pickers.PickerViewMode.Thumbnail;
FilePicker.SuggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.ComputerFolder;
FilePicker.FileTypeFilter.Add(".pcs");
FilePicker.FileTypeFilter.Add(".pcp");
Windows.Storage.StorageFile File = await FilePicker.PickSingleFileAsync();
However, Windows.Storage.StorageFile File = await FilePicker.PickSingleFileAsync()
causes this error during compilation:
Error CS4036 'IAsyncOperation<StorageFile>' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'IAsyncOperation<StorageFile>' could be found (are you missing a using directive for 'System'?)
Why is this happening? I got the code from MSDN. Could someone please help me?
Note: I am programming for Universal Windows.