4

I use Resharper's StyleCop integration when I am writing code to give me consistently styled code. I am using the full standard rule set.

This leads to Resharper regularly reminding me about

SA1101: Prefix local call with "this.": The call to XXX must begin with the 'this.' prefix to indicate that the item is a member of the class

Once I've finished my edits and got Resharper happy, I check in and TeamCity's Code Inspections will run and tell me

Redundancies in Code 
  Redundant 'this.' qualifier (xxxx)
FileName.cs
22: Qualifier 'this.' is redundant
23: Qualifier 'this.' is redundant
33: Qualifier 'this.' is redundant
etc

I know I can always disable the SA1101 error in every project in every solution or in every developers global file, but ideally I'd prefer to keep the standard and disable the checking of this error in Code Inspections.

Any idea how? Or any alternative ideas?

AlSki
  • 6,820
  • 1
  • 26
  • 38

1 Answers1

2

See http://confluence.jetbrains.com/display/TCD7/Inspections+(.NET)#Inspections%28.NET%29-Additionaloptions for instructions on pointing the TeamCity inspection runner at alternate ReSharper settings.

The settings file you provide should disable the "redundant this." inspection. If you're not sure how to do this, take a look at your client-side ReSharper settings file, which presumably already has it disabled.

Nicole Calinoiu
  • 20,387
  • 2
  • 41
  • 49
  • Thanks, that's perfect. Although my client side didn't have it disabled, weird. However I've generated the solution level xxx.DotSettings file and checked it in, and tonight's nightly build will let me know. – AlSki May 02 '13 at 15:39
  • I get the same problem. Even though it is disabled in the DotSettings file i provide to team city, it never gets applied. – Mr Balanikas May 12 '16 at 12:34