Solved

make async method com friendly

Posted on 2015-01-05
6
84 Views
Last Modified: 2015-01-14
i have the following method in my class:
public async Task<int> FetchEventsAsync()

I compile to make class com visible, but get the following error:
 Warning: Type library exporter encountered a generic type instance in a signature. Generic code may not be exported to COM.

how do I make this function non-generic?
0
Comment
Question by:dhenderson12
  • 4
  • 2
6 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
Async--in this context--is a .NET specific idea. Why do you need this in COM? Why not just expose a synchronous API for COM purposes?
0
 

Author Comment

by:dhenderson12
Comment Utility
my thinking is that this function raises events that it receives from calling a web api with a 60 second timeout (in the web api itself).  By calling it async it will effectively run in its' own thread without locking up the rest of the web page (it is an embedded object on a web page).
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
My guess is that you'll have to fall back to regular threading, but hold out for more responses.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:dhenderson12
Comment Utility
Can you provide any guidance on how to implement regular threading to handle this?  The bottom line is that I need to raise any events available to my web page.  The event handler on the web page will then make another call to fetch any new events after processing the event.  BTW, the event is just a string, which will be parsed in the javascript code of the web page.
0
 

Author Comment

by:dhenderson12
Comment Utility
ok, I resolved the problem:  just made the async method I was calling return a void.
0
 

Author Closing Comment

by:dhenderson12
Comment Utility
thanks for the help.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now