SA1401:FieldsMustBePrivate not working on private class

Jul 6, 2011 at 6:25 PM

I have this code:

namespace SomeNamespace
{
    /// ...
    public class SomeClass
    {
        // ...

        /// <summary>
        /// Represents the notification information.
        /// </summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.Maintainability", "SA1401:FieldsMustBePrivate", Justification = "Private class")]
        private class NotificationInfo
        {
            /// <summary>
            /// The notification image.
            /// </summary>
            public ImagemMensagem Imagem;

            /// <summary>
            /// The notification title.
            /// </summary>
            public string Titulo;

            /// <summary>
            /// The notification message.
            /// </summary>
            public string Mensagem;

            /// <summary>
            /// The notification source.
            /// </summary>
            public NotaPessoa Nota;
        }
    }
}

and still get SA1401 violations.

What am I doing wrong?

------ StyleCop 4.5 (build 4.5.25.0) ------


Jul 11, 2011 at 9:13 AM

Try [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Private class")]

Jul 11, 2011 at 9:43 AM

OOPS!

Thanks. I always forget the Rules part.