Loading ...

Resharper: Force braces in if-else, for and foreach loops | CodeAsp.Net

Resharper: Force braces in if-else, for and foreach loops

 /5
0 (0votes)

I use to write curly braces for if-else, for and foreach loops even if they are of single line statements. If you want to to force Resharper to add it you can do that via

Resharper > Options > C# > Formating Style > Braces Layout

 

 

You need to set the "Add Braces" option to all the highlighted options in the above screenshot. After that you need to run "Full Cleanup" to make Resharper add braces for you.

Comments (no comments yet)

Top Posts