Which attribute is used to prevent a public .NET class from being exposed to COM?
Explanation
The ComVisible attribute controls whether a .NET class is visible to COM. Setting this attribute appropriately hides the class from COM. DllImport is used for calling unmanaged code, and COM Interop refers to the overall interoperability mechanism, not an attribute. Therefore, only the ComVisible attribute is used for hiding classes from COM.