0

I am trying to configure an application for the Microsoft Store. I have the app uploaded to the store and have installed it from there onto my machine (as per MS instructions).

The app itself is .Net written in C# with a UWP wrapper that creates a MSIX package. The app package and everything that goes with it is working/uploaded etc.

From the app and following various instructions that all seem to follow the same theme, the following should work. Using the Windows.Services.Store and adding the interface due to needing the Desktop Bridge, the condensed lines of importance are...

[ComImport]
[Guid("x-y-z")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IInitializeWithWindow
{
    void Initialize(IntPtr hwnd);
}


private static async Task<bool> InitializeLicense()
{
    StoreContext Store = StoreContext.GetDefault();
    StoreAppLicense License = await Store.GetAppLicenseAsync();

    return true;
}

The bit..

await Store.GetAppLicenseAsync();

Shows error:

Error CS4036 'IAsyncOperation' does not contain a definition for 'GetAwaiter' and no extension method 'GetAwaiter' accepting a first argument of type 'IAsyncOperation' could be found (are you missing a using directive for 'System'?)

I am kind of stuck here. This seems to be what all the examples show, at least to this point. I figure I am missing something simple - any help appreciated.

damichab
  • 162
  • 10
  • I haven't done much in this realm, but [this](https://stackoverflow.com/a/44102996/2084315) question and answer look similar. Seems like you're missing a reference. – ps2goat Apr 17 '20 at 03:07
  • 3
    Does this answer your question? [FromBluetoothAddressAsync IAsyncOperation does not contain a definition for 'GetAwaiter' error](https://stackoverflow.com/questions/44099401/frombluetoothaddressasync-iasyncoperation-does-not-contain-a-definition-for-get) – Scratte Apr 21 '20 at 18:14

1 Answers1

0

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

damichab
  • 162
  • 10
  • Can you add the details to what you did to solve it here (don't forget proper attribution, see [referencing](https://stackoverflow.com/help/referencing))? Or mark your Question as a duplicate to the other Question? – Scratte Apr 20 '20 at 18:33