C# 发生了 NonComVisibleBaseClass异常

环境:Window10
VS2015
.net版本

异常信息:
发生了 NonComVisibleBaseClass
其他信息: 执行了 QueryInterface 调用,请求提供 COM 可见的托管类“MS.Internal.AutomationProxies.WindowsEditBox”的类接口。不过,由于该类是从非 COM 可见的类“MS.Internal.AutomationProxies.ProxyHwnd”派生的,QueryInterface 调用将失败。这样做的目的是避免非 COM 可见的基类受 COM 版本规则的约束。

解决:1、直接运行Exe文件
2、调试->窗口->异常设置->Managed Debugging Assistants->NonComVisibleBaseClass(去除勾选即可)

原文地址:https://www.cnblogs.com/qixiaolan/p/13931969.html