How to disable Managed Debug Assistants?

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 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.

Here is the right solution:

Bring up the Debug -> Exceptions dialog. Under Managed Debugging Assistants, uncheck the InvalidVariant MDA.

Comments (6)

  1. Scott Singer says:

    Disabling the MDA via the Debug | Exceptions menu only disables *reporting* of the condition.  The MDA will still be "alive" and hooked in.

  2. Gab says:

    I love you!

  3. Todd Horst says:

    ctrl+alt+e will launch the menu. I didnt see the option in 2010 under the debug menu, but the key combination still works

  4. ok says:

    从非托管 VARIANT 转换为托管对象的过程中检测到无效 VARIANT。将无效 VARIANT 传递给 CLR 会导致意外的异常、损坏或数据丢失。http://www.g001.net参考

  5. ridy says:

    从非托管 VARIANT 转换为托管对象的过程中检测到无效 VARIANT。将无效 VARIANT 传递给 CLR 会导致意外的异常、损坏或数据丢失

Skip to main content