Search code examples
c#resharperstylecop

Should a local const variable start with Upper or lower casing


Got a style conflict between StyleCop and Resharper. Stylecop 1303 says that const vars should start uppercase and I agree. Resharper says OK for class-wide const declarations, but when using a const in a local (e.g. method) scope, Reshaper doesn't approve and wants to make everything camelCasing.

Of course no problem to disable this rule in R#, but what could be the reason behind this rule? Anyone any thoughts?


Solution

  • If you download Stylecop for Resharper then it comes with a Resharper settings file that will fix this for you. It's also a great way to get Resharper to help you with Stylecop compliance:

    http://stylecopforresharper.codeplex.com/