Skip to content

Gendarme.Rules.Interoperability.Com.AvoidNonPublicFieldsInComVisibleValueTypesRule(2.10)

Sebastien Pouliot edited this page Jan 22, 2011 · 2 revisions

AvoidNonPublicFieldsInComVisibleValueTypesRule

Assembly: Gendarme.Rules.Interoperability.Com
Version: 2.10

Description

This rule checks for ComVisible value types which contain fields that are non-public.

Examples

Bad example:

[assembly: ComVisible (false)]
namespace InteropLibrary {
    [ComVisible (true)]
    public struct BadStruct {
        internal int SomeValue;
    }
}

Good example:

[assembly: ComVisible (false)]
namespace InteropLibrary {
    [ComVisible (true)]
    public struct BadStruct {
        public int SomeValue;
    }
}
Clone this wiki locally