Skip to content

IBackgroundTask::Run is never called #2490

Answered by mqudsi
mqudsi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Arup,

Thanks for taking a look! I assumed that much, but that's code that was working fine for me for interoping with COM types. It turns out I was running into a fundamental limitation of .NET 5+ where most COM-interop code was stripped from the language/compiler, so those projects weren't of any use. Basic IUnknown support remains, which is why the code worked for me in other projects, but IBackgroundTask seems to require more than just that for the CCW to work.

The solution is found in this document that explains how to migrate COM interop code to .NET 5. I had to replace Marshal.GetComInterfaceForObject with the new WASDK-provided MarshalInterface<T>.FromManaged(...) so the line no…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by mqudsi
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants