如何修复警告 "Non COM-visible value type is being referenced either from the type currently being exported or from one of its base types"?

How to fix a warning "Non COM-visible value type is being referenced either from the type currently being exported or from one of its base types"?

我开发了一个 ActiveX 组件。它继承自 System.Windows.Forms.UserControl.

当我在 Visual Studio 中构建我的项目时,我得到 0 个错误和大约 20 个警告,如下例所示: "warning : Type library exporter warning processing 'ActiveXControl.ActiveXControl.get_Anchor(#0), ActiveXControl'. Warning: Non COM visible value type 'System.Windows.Forms.AnchorStyles' is being referenced either from the type currently being exported or from one of its base types."

我已尝试 google 解决这些警告的解决方案,但我找不到任何对我有帮助的东西。

知道如何修复这些警告吗?

在 post 的第一条评论中查看答案。