IdentifiersShouldHaveCorrectSuffix

IdentifiersShouldHaveCorrectSuffix

On this page linked above, under the section "When to Exclude Messages", it is missing an exclusion instance that I believe should be in place. If I create a collection class and derive it from a base collection class, but want this new collection to also be a base class, then ending the collection's name with Base should be a valid exclusion reason.

Example: MyCollectionBase derives from NameObjectCollectionBase. Currently, FxCop would flag MyCollectionBase with the IdentifiersShouldHaveCorrectSuffix error.

public class MyCollectionBase : System.Collections.Specialized.NameObjectCollectionBase
{

}



Answer this question

IdentifiersShouldHaveCorrectSuffix

  • aZed

    If that's the case, why is Base still being used in the .Net Framework

    Thanks,
    Mythran

  • Guillermo D. Polonsky

    Hi Mythran,

    The documentation on GotDotNet is out of date. We're working on updating this. Until then I recommend you use msdn documentation for the Visual Studio Code Analysis. Just search in your favorite search engine on the rule name +msdn.

    e.g.

    IdentifiersShouldHaveCorrectSuffix +msdn should find http://msdn2.microsoft.com/en-US/library/ms182244(VS.80).aspx

    On this specific subject. Base as a suffix was something that was used in some instances of classes created in .net 1.0, before the guidelines where finalized. Currently it is recommended not to use Base as a suffix.

    Regards,

    Jeffrey


  • IdentifiersShouldHaveCorrectSuffix