0

ReSharper wants to replace for-each by LINQ queries. I don't like that, and I don't want ReSharper even suggesting it.

How can I disable this?

I cannot find this in the ReSharper settings.

I don't want this // ReSharper disable LoopCanBeConvertedToQuery to be around each for-each.

Gerald Versluis
  • 30,492
  • 6
  • 73
  • 100
Rob
  • 3,556
  • 2
  • 34
  • 53

1 Answers1

1

I have a newer version, ReSharper 9, but here it is under ReSharper > Settings > Code Inspection > Inspection Severity. I think it might be there in your version as well.

There is a long list of all things it can show improvements on. Somewhere in there is Language Usage Opportunities which has two settings about loops and LINQ.

ReSharper Settings

In ReSharper 9 there is also a possibility to search the settings above the treeview on the left or above the list in the Inspection Severity screen. Just type 'LINQ' there and it will show you the settings described above immediately.

Gerald Versluis
  • 30,492
  • 6
  • 73
  • 100