This project is read-only.

StyleCop & ReSharper 8.1 Cleanup code not correct

Jan 22, 2014 at 9:19 AM
Edited Jan 22, 2014 at 9:57 AM
I noticed that ReSharper's (with StyleCop) 'Cleanup Code' generates a lot regions which StyleCop will complain about. After choosing the responsible ReSharper's 'Type Memebers Layout' I noticed, that StyleCop is complaining about the order of my memebers.

In the ReSharper-Tools-StyleCop I got a warning like to reset my ReSharper options to meet StyleCop. I did, but next look into the options, I saw the same. Seems like the options from StyleCop haven't been set or saved correctly. I needed to do this a view times. (Reset ReSharper, restart VS,... Well, I don't know why)

Suddenly the options warning was away. I got a StyleCop setting in CodeCleanup. But it still doesn't work. I always get theses regions. Even though I can see the StyleCop settings in the 'Type Memebers Layout' like (<!-- StyleCop pattern --> <Pattern RemoveAllRegions="true"> ...)

I removed the regions settings in the 'Type Memebers Layout' by hand. But the member sorting still doesn't work like StyleCop expects.

I gues this is a bug in the StyleCop function to setup ReSharper?

How should the 'Type Memebers Layout' look like?

Software: Windows 8.1, Visual Studio 2013, Resharper 8.1, StyleCop 4.7

The ordering problem was related to my fields. In the 'Type Memebers Layout' I now also removed the Sections 'Cosntants', 'Static fields' and 'Fields'. Replaced them with the following and now it works like it schould :)
<!-- Constants, Fields -->
    <Or Weight="200">
      <Kind Is="constant"/>
      <Kind Is="field"/>
    <Access Order="public internal protected-internal protected private"/>
PS. Also removed all Regoin attributes.