1

I have a list with several objects with different IDs.

In order to know the ID of an object I have to call a COM method:

fooList[i].GetID()

In the Immediate window I can write:

? fooList[0].GetID()

And it works perfectly.

However, I would like to iterate on the list and get all the IDs. I tried:

? fooList.Select(f => f.GetID())

But apparently it isn't supported

Error: Evaluation of method System.Linq.SystemCore_EnumerableDebugView`1[System.String].get_Items() calls COM method IFoo.GetID(). Evaluation of methods on COM objects is not supported in this context.

Is there a way I can get the IDs of all objects with a single loop?

  • Tools > Options > Debugging > General, tick "Use Managed Compatibility Mode". That replaces the buggy new debugging engine with the one used in VS2010, the good one. As long as you don't have to debug .NETCore programs you'll have few reasons to turn it off again. – Hans Passant Oct 09 '18 at 09:15

0 Answers0