Frombluetoothaddressasync Iasyncoperation Does Not Contain a Definition for 'Getawaiter' Error

FromBluetoothAddressAsync IAsyncOperation does not contain a definition for 'GetAwaiter' error

To await an IAsyncOperation, you need two things:

  • A reference to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll
  • A reference to C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Facade\Windows.WinMD

If either reference is missing then it won't work. You can also use the UwpDesktop nuget package, that will do the work for you.

Note: specifically GetAwaiter is extension in System namespace that is available from those references (you still need using System; - make sure you have not removed it from the file). The extension info is on MSDN - WindowsRuntimeSystemExtensions.GetAwaiter.

IAsyncOperationIReadOnlyListUserNotification' does not contain a definition for 'GetAwaiter'

You should add

 using System.WindowsRuntimeSystemExtensions;

this is from the System.Runtime.WindowsRuntime assembly and holds a class with the GetAwaiter extensions.

GetAwaiter not using system

Add below using, this is from the System.Runtime.WindowsRuntime assembly and holds a class with the GetAwaiter extensions.

using System.WindowsRuntimeSystemExtensions;

Create file in StorageFolder

You should write using System; at the the top of the file.

Connecting to bluetooth device using BluetoothLEDevice.FromIdAsync results in errors

My answer is late, but I was struggling with the same problem, and the solution is to include this .dll
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5\System.Runtime.WindowsRuntime.dll"

How do I get an app licence from Microsoft Store?

Looks like the comment from ps2goat was right. I somehow missed the bit where of adding the references.

From the other post, this is the answer..

https://stackoverflow.com/a/44102996/3051507



Related Topics



Leave a reply



Submit