2
Vote

C# 6.0 Property with initializer reported as local variable

description

public static string SomeProperty {get;} = "test";

generates following error:

SP0100 : StyleCopPlus.StyleCopPlus : Local variable name SomeProperty doesn't conform the specified style: sampleName.

comments

dluk2 wrote Oct 16, 2015 at 11:10 AM

Temporary "fixed" for myself patching CodeHelper.cs line 430 to
        if (statement.StatementType == StatementType.VariableDeclaration
            && parentElement.ElementType != ElementType.Property)

wrote Jul 18, 2016 at 2:30 PM