1

Code Cleanup option isn't available in .Designer files. Is there any option to enable this feature?

Sadegh
  • 4,181
  • 9
  • 45
  • 78

2 Answers2

3

Remove the *.Designer.cs and/or *Designer.vb option from the Generated file masks area in ReSharper > Options > Code Inspection > Generated Code.

Be careful with cleaning them up, though, as in some cases doing so might render the code uncompilable.

Jura Gorohovsky
  • 9,886
  • 40
  • 46
  • I have removed this before discussing the question, but still Cleanup Code isn't available! – Sadegh Feb 21 '11 at 10:48
  • This shouldn't be the case. In my installation (R# 6.0 EAP) removing *.Designer.cs leads to ReSharper running code inspections over .designer.cs files and enabling Code Cleanup. Which R# version do you use? – Jura Gorohovsky Feb 22 '11 at 17:40
  • Oh my version is 5.x! Thanks a lot gorohoroh ;) – Sadegh Feb 22 '11 at 18:30
  • You're welcome. 5.x should actually work the same way in this regard. If it doesn't, that's a bug. – Jura Gorohovsky Feb 22 '11 at 20:33
2

Why do you need this, you are often examining code withing .designer files? I believe the main reason is the fact that these file are regenerated every time you make change and save the control, page etc.

dimarzionist
  • 18,517
  • 4
  • 22
  • 23