Solved

make async method com friendly

Posted on 2015-01-05
6
95 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 75

Expert Comment

by:käµfm³d 👽
ID: 40532556
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
ID: 40532717
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 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 40532741
My guess is that you'll have to fall back to regular threading, but hold out for more responses.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:dhenderson12
ID: 40532777
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
ID: 40548956
ok, I resolved the problem:  just made the async method I was calling return a void.
0
 

Author Closing Comment

by:dhenderson12
ID: 40548957
thanks for the help.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

815 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

8 Experts available now in Live!

Get 1:1 Help Now