All rules
CA1017Design Enabled by default: No

Mark assemblies with ComVisibleAttribute

Mark assemblies with ComVisibleAttribute

Microsoft docs

Description

The System.Runtime.InteropServices.ComVisibleAttribute attribute determines how COM clients access managed code. Good design dictates that assemblies explicitly indicate COM visibility. COM visibility can be set for a whole assembly and then overridden for individual types and type members. If the attribute is not present, the contents of the assembly are visible to COM clients.

Cause

An assembly does not have the System.Runtime.InteropServices.ComVisibleAttribute attribute applied to it.

How to fix violations

To fix a violation of this rule, add the attribute to the assembly. If you do not want the assembly to be visible to COM clients, apply the attribute and set its value to false.

Example

[assembly: System.Runtime.InteropServices.ComVisible(false)]
namespace DesignLibrary {}

When to suppress

Do not suppress a warning from this rule. If you want the assembly to be visible, apply the attribute and set its value to true.

Group results
0 yes 0 no
ConsensusNone (disabled)
Severity preference (yes voters)
Suggestion0
Warning0
Error0