question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The type forwarder for type 'Windows.Foundation.IAsyncOperation`1' in assembly 'Windows' causes a cycle

See original GitHub issue

I’d like to use await with IAsyncOperation. after I added

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

I got:

The type forwarder for type 'Windows.Foundation.IAsyncOperation`1' in assembly 'Windows' causes a cycle

image

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:15

github_iconTop GitHub Comments

9reactions
TechnikEmpirecommented, Apr 15, 2018

@JamesEarle @bao-qian the instructions in this repo and on the nuget site are wrong. You do not manually add the facade for the API you need. This is what causes the circular reference.

You simply add the full Windows.winmd at C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.16299.0\Windows.winmd and System.Runtime.WindowsRuntime. That’s it. Note when I say “full”, I mean the .winmd file should be a few megabytes. There’s plenty of them with the same name sprinkled around that are a few kb and it’s easy to screw up and select one of these.

Then, wherever you call await on an IAsyncOperation, make sure you have using System; in the same source file.

Hope this helps people.

9reactions
TechnikEmpirecommented, Mar 9, 2018

This issue is currently crushing my hopes and dreams.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Type forwarded to assembly 'Windows version=255.255. ...
The error says: The type forwarder for 'Windows.System.UserProfile.LockScreen' in assembly 'Windows' causes a cycle. The type name 'LockScreen ...
Read more >
Console App (Non UWP) with CS/WinRT
I was able to access WinRT API like Windows. ... CS0012: The type 'IAsyncOperation<>' is defined in an assembly that is not referenced....
Read more >
Suddenly unable to build solutions anymore.
WSAAsync.Internal.cs(7,33): error CS0731: The type forwarder for type 'Windows.Storage.StorageFolder' in assembly 'Windows' causes a cycle
Read more >
WinRT/UWP Bluetooth APIs returning [System. ...
Hey all, I'm trying to leverage the WinRT Bluetooth Low Energy (BLE)/ Generic Attribute Profile (GATT/GAP) APIs in PowerShell for a project ...
Read more >
The type 'IAsyncAction' is defined in an assembly that is not ...
The type 'IAsyncAction' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found