# Friday, 22 October 2010

At my current client I was tasked with implementing coding standards and styles and developing a process so the configurations can be easily maintained and shared.  ReSharper was already in place at the client and the since 99% of what they wanted to enforce, initially at least, was style related I chose to combine ReSharper with StyleCop.

After looking around the interwebs for awhile I realized this process is either impossible or undocumented…or both.

The process I came up with is about 90% of what I was hoping and still requires two manual steps by the developer but overall it is solid.  So, let’s get started.  First download and install the following tools:

  1. StyleCop 
  2. StyleCop+

Although StyleCop+ is technically not required it does a great job with allowing you to extend and customize a lot of the built in StyleCop rules.  So I certainly recommend it.

The trick with StyleCop is that it will continue to look up the code tree for settings files and keep adding them together and then adds the settings file from StyleCop install directory to top things off.  That is unless you tell it to do otherwise.  What where going to do is first place a Settings.StyleCop file where all devlopers can access it.  Next we are going to place another at the root of our code directory.  So if your code resides at C:\Dev\Code then place the Settings.StyleCop file there.  We can then open up the settings file we placed out on the network that everyone has access to and tell it not to merge with any other settings file.  This will be the official settings file.

image

Next we will open the settings file in the root of our source tree and tell it merge only with the settings in the shared location.

image

Now once you make changes at the shared level they will be merged with each developers settings file.

Next we can deal with ReSharper…Stay Tuned!

Friday, 22 October 2010 23:25:57 (Central Daylight Time, UTC-05:00)
Why not just use StyleCop For Resharper?
Shazam
Monday, 25 October 2010 19:13:51 (Central Daylight Time, UTC-05:00)
Shazam,
We had to do deal with StyleCop directly for setting up the StyleCop rules because we wanted to shared the rules between dev machines and the build servers. We most certainly are using StyleCop for ReSharper on the dev boxes.

Thanks for the Comment!
Saturday, 26 March 2011 16:44:34 (Central Standard Time, UTC-06:00)
thedentmindtex
Thursday, 31 March 2011 04:47:01 (Central Standard Time, UTC-06:00)
Enter the code shown (prevents robots):
Friday, 01 July 2011 08:08:19 (Central Daylight Time, UTC-05:00)
yggbar soffa
Saturday, 30 July 2011 10:45:38 (Central Daylight Time, UTC-05:00)
This blog information is so helpful for all mankind .it is a great article for that requirement.Thank you for submitted that blog.
Saturday, 02 March 2013 16:21:13 (Central Standard Time, UTC-06:00)
I am the opposite of lazy. I like the motto: “Been there done that!”. It makes me think about multiple opportunities that arise in our lives and if we are bold enough we take them. Furthermore, I wish to live many more years if possible and travel as much as I can. For instance I am one of the most devoted travellers to London because I love this city very much. Next week I visit it again!
deniss
Monday, 04 March 2013 03:05:28 (Central Standard Time, UTC-06:00)
I heard that Bora Bora is a very expensive place to go. There really is no cheap way to do it. There are less expensive ways to do it, but it's not going to be cheap any way you cut it. Even so I believe that a bora bora getaway once a year for a special occasion like a birthday, it will be great for you and your family.
punguta
Thursday, 01 December 2016 19:02:06 (Central Standard Time, UTC-06:00)
Aloha, the weather was really dreadful this morning so I took it upon myself to call in sick and explore the net instead, it turned out to be honestly a marvelous event for me as I dropped by at your blog. I just needed to compliment you upon the quality of the work you have done here and to send you the best of luck with it as you progress going forward. It was a pleasure to surf your site and I will certainly be dropping by again shortly to find out how you are doing. Take care and I will obviously see you back here very soon - Trevor Tenerife
Trevor Tenerife
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview