Solved

make async method com friendly

Posted on 2015-01-05
6
90 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
DevOps Toolchain Recommendations

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

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Tool Box 2 34
Name space syntax error 12 40
VB.Net How to Exit Sub - Exit Form??? 5 48
Receiving a string from a WebService Push 21 36
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
Send secure, cloud-based, encrypted alerts and maintain HIPAA compliant messaging. Integrates priority & secure messaging into one application. Ensures IT, emergency respondents and healthcare professionals that their critical messages are never mis…

911 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

18 Experts available now in Live!

Get 1:1 Help Now