How to reorder type members with Resharper?

AngryHacker picture AngryHacker · Sep 17, 2009 · Viewed 35.6k times · Source

Typical scenario: a class that a lot of people have worked on. I'd like to sort methods, properties, etc... in alphabetical order.

I'd like to be able to do this within the region or globally in the class.

I see the feature in Resharper to do it, but it does not seem to do anything.

Answer

Lucero picture Lucero · Sep 17, 2009

Use the "Cleanup Code" functionality.

The order of the members can be set up in the ReSharper options in Languages, C#, Type Members Layout. This is a well documented XML layout specification which ReSharper uses when reordering members.