Calling threads through COM interop
<p>I get an error whenever I try to call a C# thread from Visual Basic classic through COM. The Error says that generic types cannot be marshaled which is weird since there are no generics involved. </p>

<p>COM interface:</p>

<pre><code>[Guid("C8B306A5-980D-4226-8130-5E2E0F710FC2")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface comInterface
{
    [DispId(1)]
    Task firstTask();
}
</code></pre>

<p>Implementation:</p>

<pre><code>[Guid("0D5E5234-B1C0-4CFA-9B35-21F091E2E8C4")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("COMproject.implementClass")]
public class implementClass : comInterface{
public async Task firstTask(){
//doSomething
}
</code></pre>

<p>Call in Vb6:</p>

<pre><code>Dim comObject As muhDLL.comInterface
Set comObject = New muhDLL.implementClass
comObject.firstTask
</code></pre>

<p>I can just create a method which calls the thread in C# and expose the method through COM but then I do get warnings and the code looks ugly in general. Is there any way I can directly call an async task through COM and why does COM not seem to support tasks or am I doing something completly wrong? </p>