Where is the Stylecop configuration file?

こ雲淡風輕ζ 提交于 2019-12-03 09:36:16

If you installed Stylecop via NuGet (the StyleCop.MSBuild package), then you will not have the folder detailed in the other answers.

You will find the file in your project folder here:
packages\StyleCop.MSBuild.{version}\tools\Settings.StyleCop

You should copy this file to the root of your project.

If you would rather not manually edit the file, there is also a nice gui tool called StyleCopSettingsEditor in the tools folder, which you can just drag your settings file onto.

NikolaiDante

If you copy the Settings.StyleCop file to the root of the solution, then it will be inherited by all projects. This means it can be kept in Source Control and accessed by any Continuous Integration server you are using.

If you reference and alter the file in C:\Program Files (x86)\StyleCop {{version}}\Settings.StyleCop this needs to be kept inline on each developer's PC. where as copying it to the root of the solution

The file Settings.StyleCop should be located in your install directory, on my machine it's here:

C:\Program Files (x86)\StyleCop 4.7\Settings.StyleCop

You can edit the rule settings by opening this file with StyleCopSettingsEditor.exe, located in the same directory (double-clicking the settings file will do the trick).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!