Marshal generic return types for com interop
- by Israel Chen
Is it possible to Marshal a generic return type as non-generic for COM interop?
Let's say I have the following class:
[ComVisible(true)]
public class Foo
{
public IEnumerable GetStr() // Generic return type
{
yield break;
}
}
I know that IEnumerable implements IEnumerable.
Can I force tlbexp.exe (via return: attribute or some other way) to expose GetStr() method
as a method returning IEnumerbale?