This post shows you how to fix "NonComVisibleBaseClass was detected" in Visual Studio 2017 or 2019.

Selecting Debug=>Windows=>Exception Settings

Selecting Managed Debugging Assistants => Uncheck the NonComVisibleBaseClass

For old Visual Studio

Navigate to Debug->Exceptions

then expand the "Managed Debugging Assistants"

Next, Uncheck the NonComVisibleBaseClass thrown option.

Finally, Click Ok