When I wrote a C# program which calls a library which is a wrapper of COM ojbect and debugging with Visual Studio 2005, I always got the annoying Managed Debug Assistants popup complains about InvalidVariant.
InvalidVariant was detected
Message: An invalid VARIANT was detected during a conversion from an unmanaged VARIANT to a managed object. Passing invalid VARIANTs to the CLR can cause unexpected exceptions, corruption or data loss.
The MSDN article http://msdn2.microsoft.com/en-us/library/d21c150d.aspx gives 3 ways to disable the MDA but none of them works for me.
There is MSDN blog about MDA but none of them get the right solution about how to disable MDA. http://blogs.msdn.com/jmstall/archive/2005/11/10/introducing_mdas.aspx
Here is the right solution:
Bring up the Debug -> Exceptions dialog. Under Managed Debugging Assistants, uncheck the InvalidVariant MDA.