0

My environment is TFS 2013, Visual Studio 2013, The [Stylecop check in policy] had been installed into TFS, it works.

Now I am creating a custom rule by the following instruction. http://stylecopplus.codeplex.com/wikipage?title=How%20to%20Create%20StyleCop%20Custom%20Rule

Currently it does not work, it uses framework 3.5, I thought it could be use higher version, so I use 4.5 to try, but it still does not work.

The instructions show placing the dll file into the styleCop folder. I put it into VS extension folder because I am using TFS style cop, but it still does not work.

Does someone create a custom rule successfully on TFS?

Jonathan Nixon
  • 4,940
  • 5
  • 39
  • 53
Kun-Yao Wang
  • 192
  • 1
  • 3
  • 16
  • possible duplicate of [Best way to integrate StyleCop with TFS CI](http://stackoverflow.com/questions/557773/best-way-to-integrate-stylecop-with-tfs-ci) – Matthijs May 19 '14 at 05:46

1 Answers1

1

Your question regards using stylecop in TFS seems to be duplicate: Best way to integrate StyleCop with TFS CI

More information regards custom rules in TFS can be found here: Enforce custom stylecop rules for a checkin policy on TFS

Also, StyleCop rules are written in .NET3.5 because this is the supported version. Trying to write rules in .NET4.5 would be silly because the rules would simply not work. The link you provided actually describes that fact.

Community
  • 1
  • 1
Matthijs
  • 3,162
  • 4
  • 25
  • 46
  • do you mean it won't work if the code is wrote by .Net Framework 3.5 but the environment is .Net Framework 4.5(I am not sure how is TFS build environment) – Kun-Yao Wang May 20 '14 at 06:08
  • Yes, I did it when I create a new .cs file. I ensure I place .dll the correct folder, but it still does not work, I am really confused. – Kun-Yao Wang May 20 '14 at 07:29
  • Your entire project has to be targeted to .NET3.5. See http://stylecopplus.codeplex.com/wikipage?title=How%20to%20Create%20StyleCop%20Custom%20Rule&referringTitle=Documentation for instructions. – Matthijs May 20 '14 at 07:31
  • Are your custom rules showing up in the settings when placing them locally in your stylecop-location? – Matthijs May 20 '14 at 07:35
  • I have never try it and I just do it, I find out my custom rule even does not work locally....... – Kun-Yao Wang May 20 '14 at 07:59
  • Then there is a problem with your rule-project. – Matthijs May 20 '14 at 08:21
  • I find out the problem and solve it, the problem is I probably Add the older version references, Stylecop.dll and Stylecopp.cSharp.dll must be the one in original folder, I was added the one in the project I downloaded. Thanks for your reply anyway and reminding me a key point! – Kun-Yao Wang May 20 '14 at 08:49