Can I use generic methods in SOLIDWORKS addin?

link 1

link 2

Above questions on stack over flow suggest that we cannot expose generic types to COM clients. Despite the fact that Visual Studio warns me of this when I use IList<T> or IEnumerable<T> the code will compile and work.

For instance take a look at below class. COM clients can see IEnumerableOfObjects but not ListOfObjects. Is this something I should rely on? Would it cause any issue for my clients?


[ComVisible(true)]
Public Class A
{
    public List<Object> ListOfObjects {get;set;}
    public IEnumerable<Object> IEnumerableOfObjects {get;set;}
}

Yes you can. Nothing should stop you. Make sure, however, you set the Embed Interop Types of all sw references to false in case you decide to use sw API types as generics.