Search code examples
c#visual-studiocode-analysisfxcop

Code analysis naming rules in Visual Studio 2012/2013


I am using German Visual Studio Professional 2012 and 2013 on a German Windows 7. According to the MSDN documentation (e.g. http://msdn.microsoft.com/de-de/library/ms182240.aspx, http://msdn.microsoft.com/de-de/library/bb264474.aspx etc) I would expect that this code

class myClass // Complete nonsense 
{ // - I only want to raise code analysis naming rules violations 
    public int addintegers(int a, int b)
    {
        checksum++; ;
        multipart++;

        int Sum = a + b;
        return (Sum);
    }
    static int X = 1;
    static int x = 2;
    int checksum;
    int multipart;

    public static int addplus(int y)
    {
        return x + X +y;
    }

will generate several code analysis warnings when I select the ruleset "Microsoft All Rules". However, I get no name rules violations in the code analysis.

Can someone please tell me what I missed? Thanks.


Solution

  • You only get Naming Rule violations on public types. It assumes you don't really care about internal code, only about your public types that other people may consume.